If you optimize all uploaded images, I hope you’ll only use the output if it’s actually smaller than the original file. My groups’ uploads are already fully optimized using various techniques.
JPEGs can be optimized too. I use jpegrescan to losslessly optimize JPEGs. Yes, JPEGs are lossy, but it’s possible to reduce their file size without any additional quality loss by rearranging the encoded data. This reduces the size of non-optimized JPEGs by 25-33%.
I’ve seen many groups save their edited grayscale pages as full color PNGs/JPEGs. Throwing away the empty color channels of a JPEG usually saves only a bit of space, but converting a colorless 24 bit RGB PNG to an 8 bit grayscale PNG often saves up to 20% (not 67% even though you go from 24 to 8 bit because the three identical color channels can be compressed somewhat efficiently). Even more stupid is that some groups save their PNGs as 32 bit RGB+alpha or 16 bit grayscale+alpha, because that’s what Photoshop does by default even when the alpha channel is fully opaque! Throwing away useless alpha channels can save up to 10%. Color and transparency detection would need some additional computing power during an automatic optimization run, though.
Please don’t reduce the colors of PNGs to 16, though. That would make all the editors who paid extra attention to screentones and gradients cry (hint: dithering and banding) and quite often black and white won’t be 0 and 255 anymore, which looks shit and makes the editors cry more.
JPEGs can be optimized too. I use jpegrescan to losslessly optimize JPEGs. Yes, JPEGs are lossy, but it’s possible to reduce their file size without any additional quality loss by rearranging the encoded data. This reduces the size of non-optimized JPEGs by 25-33%.
I’ve seen many groups save their edited grayscale pages as full color PNGs/JPEGs. Throwing away the empty color channels of a JPEG usually saves only a bit of space, but converting a colorless 24 bit RGB PNG to an 8 bit grayscale PNG often saves up to 20% (not 67% even though you go from 24 to 8 bit because the three identical color channels can be compressed somewhat efficiently). Even more stupid is that some groups save their PNGs as 32 bit RGB+alpha or 16 bit grayscale+alpha, because that’s what Photoshop does by default even when the alpha channel is fully opaque! Throwing away useless alpha channels can save up to 10%. Color and transparency detection would need some additional computing power during an automatic optimization run, though.
But seriously. Anyone who saves a grayscale page as 32 bit RGB+alpha should be forced to personally apologize to any user on a metered Internet connection. Worldwide. I’ve shaved 75% off some chapters I downloaded from some groups. That means that metered users pay four times as much as they need to. /rant
Please don’t reduce the colors of PNGs to 16, though. That would make all the editors who paid extra attention to screentones and gradients cry (hint: dithering and banding) and quite often black and white won’t be 0 and 255 anymore, which looks shit and makes the editors cry more.