Curious about this line here on the optimization guidelines:
In general, prefer JPG format for textures over PNG.
Is this because when compressed, JPG’s are generally smaller or is there some optimization within the engine that makes PlayCanvas prefer JPG’s? I am putting some finishing touches on a project and am seeing some files that could potentially be made into JPG’s but the size difference between JPG and PNG in this case isn’t very large (like 1 KB or so).
Okay so if there is not a size difference, there is not a reason to switch to JPG from PNG? The only reason I could even think of is so that the engine wouldn’t have to compute anything on the alpha channel but I’m not sure if that is even true.
Both JPG and PNG have their pros and cons, but for web-based apps like PlayCanvas, JPG is often preferred for smaller file sizes. If you are not using transparency, converting PNGs to JPG can help optimize load times.
And for reducing image file size you can try https://jpegcompressor.com/ to compress even more without losing quality. This tool supports multiple image formats such as JPEG, JPG, PNG, SVG, and many more.
These days webp might be even better option compared to jpg, as for the same quality it’s around 25% smaller, and can optionally store alpha channel too.