• I use the GD extension conversion.

    The webp image has a solid black color instead of the transparent alpha channel.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have the same issue!

    Plugin Author rosell.dk

    (@roselldk)

    Yes, I’m aware. I probably should add a warning in the UI about this until this is fixed (if it can be fixed).

    Can you tell me the version number of your GD? (do a test conversion and view the log). In test conversion, does “dice.png” fail while “palette-based-colors.png” succeeds?

    See also: https://github.com/rosell-dk/webp-express/issues/374

    Plugin Author rosell.dk

    (@roselldk)

    I have done a lot of research and testing and unfortunately, it seems that all hope is lost for retaining alpha channel for webp on old Gd. Here is why

    I would still appreciate your Gd version number in order to display a warning on affected platforms.

    Hi Rosell.dk,
    Thank you for the swift response!

    Below is the log (GD Version: 2.1.1) :

    Converter set to: gd
    
    *WebP Convert 2.3.0*  ignited.
    - PHP version: 7.0.33-0ubuntu0.16.04.6
    - Server software: Apache/2.4.18 (Ubuntu)
    
    Gd converter ignited
    
    Options:
    ------------
    The following options have been set explicitly. Note: it is the resulting options after merging down the "jpeg" and "png" options and any converter-prefixed options.
    - source: (...)/test-pattern-tv.jpg
    - destination: (...)/test-pattern-tv.jpg.webp
    - default-quality: 70
    - log-call-arguments: true
    - max-quality: 80
    - quality: "auto"
    
    The following options have not been explicitly set, so using the following defaults:
    - skip: false
    
    The following options were supplied but are ignored because they are not supported by this converter:
    - encoding
    - metadata
    - near-lossless
    - skip-pngs
    ------------
    
    GD Version: 2.1.1
    image is true color
    Quality of source is 93. This is higher than max-quality, so using max-quality instead (80)
    Fixing corrupt webp by adding a zero byte (older versions of Gd had a bug, but this hack fixes it)
    
    Converted image in 15 ms, reducing file size with 73% (went from 28 kb to 8 kb)
    Plugin Author rosell.dk

    (@roselldk)

    Thanks, ramconsulting.

    For those that experiences this, here are your options:

    – Disable PNG. Gd isn’t very good at converting PNG anyway, as Gd cannot create lossless webp, only lossy webp
    – Ask your host to upgrade Gd
    – Ask your host to install imagick, vips or cwebp
    – Use a cloud converter (ewww or connect to a remote webp-express)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘The webp served instead of png has black background instead of transparent’ is closed to new replies.