nystudio107 / craft-imageoptimize

Automatically create & optimize responsive image transforms, using either native Craft transforms or a service like Imgix, with zero template changes.
https://nystudio107.com/plugins/imageoptimize
Other
235 stars 36 forks source link

Don't force placeholder image format #149

Open ilicmarko opened 5 years ago

ilicmarko commented 5 years ago

Generated placeholder images have a forced jpg file format. Here is an example

image

This is a PNG image that has been converted to JPG and gets a black background. This "looks" wrong when it loads.

I find a bit of code that forces a JPG format. https://github.com/nystudio107/craft-imageoptimize/blob/2a9b385fb2ba38a601b4a04d21f62a62d8594396/src/services/Placeholder.php#L286

Maybe this can be improved to don't force the format like on the transformations or the solution to this is to generate a silhouette?

khalwat commented 5 years ago

Yeah I wish there was a way to specify what color it'd use on the background in these cases.

I'll have to think about the implications of not forcing the image to be a JPEG.