We have plenty of png images in DAM. We want to compress these images in such a way that their quality/resolution should not compromise. I have gone through several options and want to know the best one.
- ImageMagick https://helpx.adobe.com/experience-manager/6-3/assets/using/best-practices-for-imagemagick.html
We are on AEM 6.0 and wondering whether this features will work well in 6.0 version. Moreover, This tool have some vulnerabilities as well.
- DAM Update Asset Workflow
We can update the workflow to add our custom code block and by using JAVA7 IO api we can perform the compression. Also can we add a new process step at first stage so that can compress the images as first operation when this workflow initiate. Any other thoughts are welcome.
- 3rd Party API
Are there any third party API where using CURL we can compress the images apart from TinyPNG.
Have started using ImageMagick on 6.0:
EPS thumbnails (powered by ImageMagick) Step is as follows :
Web enabled rendition process step is as follows :
Problem :
- Image size does not getting compress and size increased from 206KB to 208KB.
AEM Logs says :
13.04.2018 15:05:43.111 *INFO* [JobHandler: /etc/workflow/instances/server0/2018-04-13_1/update_asset_439:/content/dam/A.jpg/jcr:content/renditions/original] com.day.cq.dam.core.process.CommandLineProcess execute: executing command line ["C:\Program Files\ImageMagick-6.9.9-Q16\convert.exe" -depth 8 -define jpeg:size=319x319 A.jpg -thumbnail 319x319 cq5dam.thumbnail.319.319.png] for asset [/content/dam/A.jpg]. (Size is 208KB of thumbnail generated)
If I run Locally, I can see the file size reduced to 130KB.
"C:\Program Files\ImageMagick-6.9.9-Q16\convert.exe" -depth 8 -define jpeg:size=319x319 A.jpg -thumbnail 319x319 cq5dam.thumbnail.319.319.png
Any Idea why image in not compressing on AEM?


-define JPEG:...which doesn't apply unless you write a JPEG yet you also say you can't accept any loss of quality - which is inevitable if you use JPEG. Please clarify. Also, it seems odd to be trying to reduce sizes when storage is only getting cheaper. - Mark Setchell