How to convert JPG to PNG on upload (via add_image_size)?


I am looking for a way to have one of the additional images sizes saved as PNG. Ideally the PNG-Version would be rendered on upload and defines through add_image_size.

So far I have only found one WP-plugin that has the built in capability of converting JPGs to PNGs (EWWW Image Optimizer) but it does not really provide the functionality I’m looking for.

I know this should be possible through the PHP function imagecreatefromjpeg – but currently I just don’t know where / how to hook that into add_image_size or wherever taht should be hooked in.

I hope somebody has done this before? Any pointers / suggestion appreciated. Thank you!

tillinberlin 2 years 2020-10-23T08:10:27-05:00 0 Answers 10 views 0

Leave an answer