onurzorluer / react-image-file-resizer

Resize Local Images with React 🌄 🌅
MIT License
317 stars 41 forks source link

PNG or WEBP images with transparancy turn black upon conversion to jpeg #40

Closed zehawki closed 3 years ago

zehawki commented 3 years ago

Describe the bug Any png or webp image which has a transparency layer, turns to black back when converted to jpeg

To Reproduce Steps to reproduce the behavior:

  1. Take any png image eg http://www.pngmart.com/image/153441
  2. compressFormat = 'JPEG'

Expected behavior Transparent back should preferably turn white. This is what photoshop does BTW.

DickShern commented 3 years ago

Is there any updates to this? I would prefer to export with a white background as well

andresriveratoro commented 3 years ago

See https://github.com/onurzorluer/react-image-file-resizer/pull/54

jpnuma commented 3 years ago

Still waiting for author to merge this PR

khanakia commented 12 months ago

Any update below image turns to black on resize

switch (1)