Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Background Color overwrite when converting PNG images to JPG. #292

Open
francoislevesque opened this issue Aug 20, 2021 · 0 comments

Comments

@francoislevesque
Copy link

Is your feature request related to a problem? Please describe.

We need a white background when converting PNG images to JPG.
Currently, using SharpJS, the default fill background is black. I believe this feature would benefit many other users.

Describe the solution you would like

  1. It could be a config settings on the Craft Admin panel. Ex: Default fill color: #ffffff.
  2. It could also be interesting to send a "sharpjs" parameter when creating an image URL. Ex:
// Everything in the sharpjs key gets merged with the SharpJS config.
image.url({width: 400,format: 'jpg', quality: 75, sharpjs: {flatten: {background: 'rgba(255,255,255)'}}}

Describe alternatives you have considered

I tried sending custom sharpjs parameters to the image URL generator, but found out the package doesn't use/merge custom parameters.

Thanks for the support and the great package 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant