performance
performance copied to clipboard
Transparent PNG's loses transparency with the Modern Image Formats
Bug Description
I tried the modern image formats plugin and when it converts my transparent png's to Exif AVIF it loses transparency. There should be a way to exclude transparent PNGs?
Steps to reproduce
- Go to '...'
- Click on '....'
- Scroll down to '....'
- See error
Screenshots
Additional Context
- PHP Version:
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Plugin Version: [e.g. 22]
- Device: [e.g. iPhone6]
@callievg By Exif do you mean AVIF?
@adamsilverstein Does GD or Imagick not support transparency when generating AVIF perhaps?
@westonruter Sorry Yes AVIF
@callievg Can you share your Site Health information? Specifically the Media Handling section. We should capture the specific versions of GD and ImageMagick that you have on your server.
@callievg Here's some info on how to access your Site Health info: https://yoast.com/wordpress-site-health/
Specifically, then Info tab includes a Media Handling section like this:
You can also copy the text via the "Copy site info to clipboard" button.
screencapture-innovationsoftheworld-wp-admin-site-health-php-2024-10-09-09_49_24.pdf
Here you go!
Apologies - I missed your last message.
OK, I am able to reproduce this issue even in the plugin's wp-env development environment. Specifically, this happens only with AVIF. When I am converting to WebP, then the transparency is preserved.
@adamsilverstein Do we need to have PNGs only convert to WebP for now?
or check for transparency
@adamsilverstein Do we need to have PNGs only convert to WebP for now?
Only if we can't find a fix for the issue. I believe we tested for avif transparency
or check for transparency
We do directly check for transparency and try to apply that to output images for uploaded transparent images, see https://github.com/WordPress/wordpress-develop/blob/b5df5f08e0a43a05a2a52b5c151028e0c6a6d14d/src/wp-includes/class-wp-image-editor-imagick.php#L480-L494. maybe something is off with this logic.
I will give this a test locally to see if I can reproduce. if possible, please share the image(s) you are using to test.
Here you go!
@callievg Thanks for the details. It looks like your Imagick should be able to output AVIF images with transparencies.
I'm curious if you can test a couple of things:
- can you test uploading a transparent avif and verify the subsized/thumbnail images are also transparent? You can use this image from core for testing.
- Under settings->media change this output format to WebP. Are the output files correctly transparent?
This worked fine in my testing, I uploaded a PNG with transparency and all of the output AVIF images were also transparent background images, they looked just like the original. Here is the test image I used:
Here is my media info:
This may not be version specific, the doc block in core says:
Note that Imagick::getImageAlphaChannel() is only available if Imagick has been compiled against ImageMagick version 6.4.0 or newer.
@adamsilverstein Do we need to have PNGs only convert to WebP for now?
Maybe we can use the check from core and fallback to WebP if the upload has transparency, and the output format is AVIF, and Imagick is the editor and doesn't have support for transparency (ie. getImageAlphaChannel not defined).
Report from a user on the support forum: https://wordpress.org/support/topic/avif-not-supporting-transparent-png/
This affects me too. Using your latest (current) wordpress:php8.3-fpm docker image, and served through apache on a separate container.
I can reproduce this issue as well, with the image that adamsilverstein posted above. For what it's worth, here's my WordPress setup:
wp-core
version: 6.7.1 site_language: nl_NL user_language: nl_NL timezone: Europe/Amsterdam permalink: /%postname%/ https_status: true multisite: false user_registration: 1 blog_public: 0 default_comment_status: open environment_type: staging user_count: 111 dotorg_communication: true
wp-media
image_editor: WP_Image_Editor_Imagick imagick_module_version: 1691 imagemagick_version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org imagick_version: 3.7.0 file_uploads: 1 post_max_size: 64M upload_max_filesize: 64M max_effective_size: 64 MB max_file_uploads: 20 imagick_limits: imagick::RESOURCETYPE_AREA: 31 GB imagick::RESOURCETYPE_DISK: 9.2233720368548E+18 imagick::RESOURCETYPE_FILE: 6144 imagick::RESOURCETYPE_MAP: 31 GB imagick::RESOURCETYPE_MEMORY: 16 GB imagick::RESOURCETYPE_THREAD: 1 imagick::RESOURCETYPE_TIME: 9.2233720368548E+18 imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV gd_version: 2.3.0 gd_formats: GIF, JPEG, PNG, WebP, BMP, XPM ghostscript_version: 9.55.0
wp-server
server_architecture: Linux 6.8.0-52-generic x86_64 httpd_software: Apache php_version: 8.3.16 64bit php_sapi: cgi-fcgi max_input_variables: 1000 time_limit: 120 memory_limit: 256M max_input_time: 120 upload_max_filesize: 64M php_post_max_size: 64M curl_version: 7.81.0 OpenSSL/3.0.2 suhosin: false imagick_availability: true pretty_permalinks: true htaccess_extra_rules: true current: 2025-02-07T09:35:22+00:00 utc-time: Friday, 07-Feb-25 09:35:22 UTC server-time: 2025-02-07T10:35:16+01:00
For now I'll stick to using webp, but it'd be nice if this issue can be resolved, or if we can help resolve it.
I can reproduce this as well. If I switch to WebP instead of AVIF, then uploads keep their transparency.
### wp-core ###
version: 6.8.1
site_language: en_US
user_language: en_US
timezone: +00:00
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 0
blog_public: 1
default_comment_status: open
environment_type: production
user_count: 78
dotorg_communication: true
### wp-paths-sizes ###
wordpress_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html
wordpress_size: 78.18 MB (81982096 bytes)
uploads_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/uploads
uploads_size: 2.46 GB (2646166206 bytes)
themes_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/themes
themes_size: 250.26 MB (262418405 bytes)
plugins_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/plugins
plugins_size: 14.52 MB (15227607 bytes)
fonts_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/uploads/fonts
fonts_size: directory not found
database_size: 103.86 MB (108904448 bytes)
total_size: 2.90 GB (3114698762 bytes)
### wp-dropins (1) ###
object-cache.php: true
### wp-active-theme ###
name: HS eAssist (hs-eassist)
version: undefined
author: Josh Fester
author_website: (undefined)
parent_theme: none
theme_features: core-block-patterns, widgets-block-editor, block-templates, menus, title-tag, post-thumbnails, html5, align-wide, editor-styles, editor-style
theme_path: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/themes/hs-eassist
auto_update: Disabled
### wp-themes-inactive (2) ###
Twenty Twenty-Five: version: 1.2, author: the WordPress team, Auto-updates disabled
Twenty Twenty-Three: version: 1.6, author: the WordPress team, Auto-updates disabled
### wp-plugins-active (17) ###
Attributes for Blocks: version: 1.0.11, author: skadev, Auto-updates disabled
Bugsnag Error Monitoring: version: 1.6.3, author: Bugsnag Inc., Auto-updates disabled
Embed Optimizer: version: 1.0.0-beta2, author: WordPress Performance Team, Auto-updates disabled
Enhanced Responsive Images: version: 1.4.0, author: WordPress Performance Team, Auto-updates disabled
Favicon by RealFaviconGenerator: version: 1.3.41, author: Philippe Bernard, Auto-updates disabled
Force Regenerate Thumbnails: version: 2.2.2, author: Exactly WWW, Auto-updates disabled
Health Endpoint: version: 1.0.2, author: Jon Otaegi, Auto-updates disabled
Image Placeholders: version: 1.2.0, author: WordPress Performance Team, Auto-updates disabled
Imsanity: version: 2.8.6, author: Exactly WWW, Auto-updates disabled
Modern Image Formats: version: 2.5.1, author: WordPress Performance Team, Auto-updates disabled
Object Cache Pro: version: 1.23.1, author: Rhubarb Group, Auto-updates disabled
Performance Lab: version: 3.9.0, author: WordPress Performance Team, Auto-updates disabled
Safe SVG: version: 2.3.1, author: 10up, Auto-updates disabled
Staatic - Static Site Generator: version: 1.11.3, author: Team Staatic, Auto-updates disabled
The SEO Framework: version: 5.1.2, author: The SEO Framework Team, Auto-updates disabled
WordPress Importer: version: 0.8.4, author: wordpressdotorg, Auto-updates disabled
WPVulnerability: version: 4.0.4, author: Javier Casares, Auto-updates disabled
### wp-plugins-inactive (1) ###
Autoptimize: version: 3.1.13, author: Frank Goossens (futtta), Auto-updates disabled
### wp-media ###
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1691
imagemagick_version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
imagick_version: 3.8.0
file_uploads: 1
post_max_size: 50M
upload_max_filesize: 50M
max_effective_size: 50 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 2 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 768
imagick::RESOURCETYPE_MAP: 2 GB
imagick::RESOURCETYPE_MEMORY: 965 MB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: unknown
### wp-server ###
server_architecture: Linux 5.10.0-33-amd64 x86_64
httpd_software: Apache/2.4.63 (Debian)
php_version: 8.1.32 64bit
php_sapi: fpm-fcgi
max_input_variables: 2500
time_limit: 3600
memory_limit: 256M
max_input_time: 3600
upload_max_filesize: 50M
php_post_max_size: 50M
curl_version: 7.74.0 OpenSSL/1.1.1w
suhosin: false
imagick_availability: true
pretty_permalinks: true
htaccess_extra_rules: false
static_robotstxt_file: false
current: 2025-06-13T22:08:12+00:00
utc-time: Friday, 13-Jun-25 22:08:12 UTC
server-time: 2025-06-13T22:08:12+00:00
### wp-database ###
extension: mysqli
server_version: 10.6.22-MariaDB-deb11-log
client_version: mysqlnd 8.1.32
max_allowed_packet: 134217728
max_connections: 29538
### wp-constants ###
WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content
WP_PLUGIN_DIR: /home/1441569.cloudwaysapps.com/vjrdwtexgq/public_html/wp-content/plugins
WP_MEMORY_LIMIT: 40M
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: true
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: false
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_ENVIRONMENT_TYPE: production
WP_DEVELOPMENT_MODE: undefined
DB_CHARSET: utf8
DB_COLLATE: undefined
### wp-filesystem ###
wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
fonts: does not exist
### objectcache ###
general-status: Connected
general-dropin: Valid
general-license: Valid
general-env: production
general-multisite: No
general-mu: No
general-vcs: No
general-host: cloudways
general-eviction-policy: allkeys-lfu
general-compressions: LZF, LZ4, ZSTD
general-basename: object-cache-pro/object-cache-pro.php
general-client: RedisCachePro\Clients\PhpRedis
versions-php: 8.1.32 (Outdated)
versions-igbinary: 3.2.16
versions-phpredis: 6.2.0
versions-relay: Not installed
versions-redis: 7.4.1
versions-plugin: 1.23.1
versions-dropin: 1.23.1
statistics-redis-memory: 12 MB of 96 MB
statistics-redis-keys: 2362
groups-global: [
"analytics",
"objectcache",
"blog-details",
"blog-id-cache",
"blog-lookup",
"blog_meta",
"global-posts",
"image_editor",
"networks",
"network-queries",
"sites",
"site-details",
"site-options",
"site-queries",
"site-transient",
"theme_files",
"translation_files",
"rss",
"users",
"user-queries",
"user_meta",
"useremail",
"userlogins",
"userslugs"
]
groups-non-persistent: [
"counts",
"plugins",
"theme_json",
"themes"
]
groups-non-prefetchable: [
"analytics",
"objectcache",
"userlogins",
"wc_cache_*",
"wc_session_id"
]
config-token: ••••••••001c
config-connector: RedisCachePro\Connectors\PhpRedisConnector
config-cache: RedisCachePro\ObjectCaches\PhpRedisObjectCache
config-logger: RedisCachePro\Loggers\ErrorLogLogger
config-log_levels: emergency, alert, critical, error, warning
config-scheme: tcp
config-host: 127.0.0.1
config-port: 6379
config-database: 3971
config-username: null
config-password: null
config-prefix: vjrdwtexgq
config-maxttl: null
config-timeout: 2.5s
config-read_timeout: 2.5s
config-retry_interval: 25ms
config-retries: 3
config-backoff: smart
config-persistent: false
config-shared: null
config-async_flush: true
config-group_flush: scan
config-network_flush: all
config-cluster: null
config-cluster_failover: error
config-servers: null
config-replication_strategy: distribute
config-sentinels: null
config-service: null
config-tracer: none
config-serializer: igbinary
config-compression: zstd
config-global_groups: null
config-non_persistent_groups: null
config-non_prefetchable_groups: null
config-prefetch: true
config-split_alloptions: true
config-analytics: {
"enabled": true,
"persist": true,
"retention": 7200,
"sample_rate": 100,
"footnote": true
}
config-relay: {
"cache": true,
"listeners": false,
"invalidations": true,
"allowed": null,
"ignored": [
"*:analytics:*"
]
}
config-tls_options: null
config-updates: true
config-debug: false
config-strict: false
config-save_commands: false
environment-WP_REDIS_DISABLED: 0
environment-OBJECTCACHE_CONFIG: undefined
constants-WP_DEBUG: true
constants-SAVEQUERIES: undefined
constants-WP_REDIS_DIR: undefined
constants-WP_REDIS_DISABLED: false
constants-WP_REDIS_CONFIG: {
"token": "••••••••001c",
"host": "127.0.0.1",
"port": 6379,
"database": "3971",
"timeout": 2.5,
"read_timeout": 2.5,
"split_alloptions": true,
"async_flush": true,
"client": "phpredis",
"compression": "zstd",
"serializer": "igbinary",
"prefetch": true,
"debug": false,
"save_commands": false,
"prefix": "vjrdwtexgq"
}
### staatic ###
version: 1.11.3
site_url: https://cms.dentalbilling.com/
wordpress_url: https://cms.dentalbilling.com
destination_url: /
deployment_method: Netlify
process_not_found: Disabled
lowercase_urls: Disabled
http_auth_username: Undefined
http_concurrency: 4
http_https_to_http: Undefined
http_timeout: 60
ssl_verify_behavior: enabled
ssl_verify_path: Undefined
html_dom_parser: PHP DOM Wrapper
publication_task_timeout: 180
test_request_status: 1749844992_1749846794_done
Related:
- https://github.com/WordPress/performance/issues/1798
- https://core.trac.wordpress.org/ticket/36477
- https://core.trac.wordpress.org/ticket/36477
This should be fixed for Imagick in 6.8 and for GD in https://github.com/WordPress/performance/pull/2024 (and possibly in WP 6.9).
@MaxKorlaar can you try to reproduce with WordPress 6.8?
@joshfester can you please check with https://github.com/WordPress/performance/pull/2024 - this may fix your issue if your server is choosing GD for AVIF output.
Sadly the issue has not been resolved for me yet on WordPress 6.8.2 and Modern Image Formats plugin version 2.5.1.
Below is the current server's config:
### wp-core ###
version: 6.8.2
site_language: nl_NL
user_language: nl_NL
timezone: Europe/Amsterdam
permalink: /%postname%/
https_status: true
multisite: false
user_registration: 1
blog_public: 0
default_comment_status: open
environment_type: staging
user_count: 122
dotorg_communication: true
### wp-media ###
image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1691
imagemagick_version: ImageMagick 6.9.11-60 Q16 x86_64 2021-01-25 https://imagemagick.org
imagick_version: 3.7.0
file_uploads: 1
post_max_size: 64M
upload_max_filesize: 64M
max_effective_size: 64 MB
max_file_uploads: 20
imagick_limits:
imagick::RESOURCETYPE_AREA: 8 GB
imagick::RESOURCETYPE_DISK: 9.2233720368548E+18
imagick::RESOURCETYPE_FILE: 6144
imagick::RESOURCETYPE_MAP: 8 GB
imagick::RESOURCETYPE_MEMORY: 4 GB
imagick::RESOURCETYPE_THREAD: 1
imagick::RESOURCETYPE_TIME: 9.2233720368548E+18
imagemagick_file_formats: 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVIF, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DJVU, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HEIC, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
gd_version: 2.3.3
gd_formats: GIF, JPEG, PNG, WebP, BMP, AVIF, XPM
ghostscript_version: 9.55.0
Sorry to hear that @MaxKorlaar - if possible, can you also test with https://github.com/WordPress/performance/pull/2024?
Hi sorry, haven't had a chance to test that yet -- I haven't found the time yet to convert my client's local WP development setup to use that fork.
@MaxKorlaar If it's helpful, I've just generated a build ZIP of the plugin which you can install manually via WP Admin > Plugins > Add Plugins > Upload Plugin: https://github.com/WordPress/performance/pull/2024#issuecomment-3192992545
Thanks! I installed the latest build and it seems to have resolved the issue. The example image now preserves its transparency even when converted to AVIF!
Any suggestions for fixes?
It works on my LocalWP but not on WPEngine.
Modern Image Formats 2.6.0.
WPEngine:
LocalWP:
@johnmagbag1995 I've confirmed what you're seeing. Does configuring it to use WebP instead of AVIF work for you? In any case, could you open a support ticket with WPE regarding the AVIF problem?
While looking into this, we found a post where someone had a similar issue with transparent backgrounds in AVIF files when using ImageMagick 6: Beware of transparent backgrounds when using AVIF with ImageMagick 6
TL;DR the issue was fixed in ImageMagick 6.9.12-68, according to the post.
Update, 22 December 2024: I had an email from Paulo Paracatu, who tells me this has been fixed in ImageMagick 6.9.12-68 with commit cc4e5a6. I haven’t been able to verify this myself, but it sounds like good news for anybody who has to use ImageMagick 6.
We may want to disable AVIF when we know the version of ImageMagick doesn't support transparent AVIF files. I'll open a new issue for that.
Opened an issue here to look into disabling AVIF when transparency isn't supported: https://github.com/WordPress/performance/issues/2237