Android
Android copied to clipboard
Use jpeg to store images
Using JPEG may significantly reduce images size. For example, one of my cards is 1M in png and 70k in jpg, My exported card archive is 150M in png and 3M in jpeg.
I would assume that switching it to JPEG would break the use case of users who use things like company logos with transparency.
Maybe we can somehow detect if any transparency is used and if not, compress to JPEG? Is JPEG always smaller or just most of the time?
Is JPEG always smaller or just most of the time?
If it is a photo, it will be smaller in jpeg. But indeed it does not support alpha channel.
Is JPEG always smaller or just most of the time?
You can choose different compression levels, but yes jpeg may reduce size quite a bit :)
@TheLastProject We can give the choice of either exporting to png or jpeg.
I can work on it.
We can give the choice of either exporting to png or jpeg.
I understand your suggestion, but I'm not really a fan of it. I don't think the average user should care about what image format is used, it should "just work"
JPEG and PNG have completely different usage:
- JPEG is great for photos, altering the image a litlle but reaching a good compression ratio
- PNG uses color palette to do compression, which is great for logos (no compression artefacts, and better compression level when there are only a few colors in the image with sharp edges). Plus it supports transparency.
For catima, JPEG is better when people take a picture of their card with their camera, but PNG is better when you just download the logo from a website and use it as your card image.
Hey all, I also stumbled across the storage usage of Catima in the past, too (150MB with 22 cards). Can we decrease image sizes somehow? Whether it is through image compression or storing the images in a smaller dimensions or resolutions.
Right now images are saved with 90% quality. I'm not sure about decreasing that as it may increase the risk of artifacts.
However, I do think your idea of a smaller dimension/resolution is a good idea. Maybe a good start would be to export -> change file resolutions -> import and figure out an WxH for image thumbnails and other images that still looks good but saves a good chunk of storage (I'm sure thumbnails will be able to be smaller than front/back images).
Then we could just make sure Catima always ensures the width and height are below those values before saving an image. If we make the values high enough people should still be able to somewhat zoom in and read text hopefully.
Also, we should check if the uCrop change https://github.com/Yalantis/uCrop/pull/926 also affects Catima somehow.