lcms error using ImageMagick compare on JPEGs with colour profile - imagemagick

When running compare
compare -metric MSE some-image-1.jpg some-image-2.jpg /dev/null
1) When images are identical (OK)
0 (0)
This is what I would expect to see.
2) When images differ (OK)
Error: Command failed: 13.1266 (0.000200299)
I can get the data that I want, but I'm not sure why it's presented as an error.
3) When image is a JPEG with a Photoshop colour profile (ISSUE)
Error: Command failed: lcms: Error #12288; Corrupted memory profile
This is the real issue, and only happens on JPEG images with a Photoshop colour profile - can anyone point me to why this would happen?
Environment
OS X 10.9.4
GhostScript 9.07 at /opt/Ghostscript
compare at /opt/ImageMagick/bin/compare
Version: ImageMagick 6.8.8-6 Q16 x86_64 2014-02-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
Features: DPC
Delegates: bzlib fftw jng jpeg lcms lzma png tiff webp xml zlib
Thank you for your time.

Related

Why did ImageMagick reduce my JPG quality severely when increasing saturation?

My command was convert imagename.jpeg -quality 100 -modulate 100,200 imagename-ImageMagick.jpeg and if you look at the Imgur gallery here:
https://imgur.com/a/V8zr4Lu
you can see that it has tons of JPG artefacts, to the point where the text is almost illegible. All I wanted to do was increase colour saturation.
Version info:
Version: ImageMagick 6.9.11-21 Q16 x86_64 2020-07-25 https://imagemagick.org Copyright: © 1999-2020 ImageMagick Studio LLC License: https://imagemagick.org/script/license.php Features: Cipher DPC Modules Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib heic jbig jng jp2 jpeg lcms ltdl lzma openexr png ps raw tiff webp x xml zlib
Because when you increase saturation that much you make the existing JPEG artifacts more visible (in fact you make all the image problems more visible...). Adding saturation is increasing the tone differences, while the JPEG compression is based on the idea that the tone differences it creates are still below your perception, so increased saturation makes the existing and barely noticeable artifacts suddenly very visible.
-modulate 100,200 is a very aggressive setting, try something lighter
-quality 100 is pointless, you are just saving existing artifacts with a high accuracy.
maybe try a very light blur before increasing saturation.
Using Imagemagick 6.9.12.77, it looks fine to me
convert galaxy.jpg -modulate 100,200,100 -quality 100 x.jpg
Perhaps you need to upgrade either or both Imagemagick or libjpg
convert -version
Version: ImageMagick 6.9.12-77 Q16 aarch64 17704 https://legacy.imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps raw rsvg tiff webp x xml zlib

Why does ImageMagick fail with "no decode delegate for this image format `PNG'" even when the png delegate is installed?

I'm working on openSUSE Tumbleweed.
I have ImageMagick installed.
$ convert --version
Version: ImageMagick 7.1.0-52 Q16-HDRI x86_64 20549 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(4.5)
Delegates (built-in): bzlib djvu fontconfig freetype gslib jng jpeg lcms ltdl lzma png ps raw tiff x xml zlib
Compiler: gcc (12.2)
Notice that the PNG delegate is installed, at least according to --version.
Despite this, converting fails.
$ convert covalent_platform.svg covalent_platform.png
convert: no decode delegate for this image format `PNG' # error/constitute.c/ReadImage/776.
convert: no images defined `covalent_platform.png' # error/convert.c/ConvertImageCommand/3342.
Even identifying a non-PNG file fails, with the same PNG delegate problem.
$ identify covalent_platform.svg
identify: no decode delegate for this image format `PNG' # error/constitute.c/ReadImage/776.
Any ideas for what might be wrong here?
I reinstalled libpng-devel and reinstalled IM, but the problem remains.
I figured out the problem, thanks to #fmw42 pointing out that if magick -list format has no output then the installation is bad.
I had installed IM from https://imagemagick.org/script/download.php
These downloads are not compatible with openSUSE.
After uninstalling and reinstalling IM from https://software.opensuse.org/package/ImageMagick, everything works as expected.

LZW compression creating huge files in ImageMagick

I'm using a recent version of ImageMagick on Windows 10 to resize and compress .tif files with mogrify *.tif -resize 20% -compress lzw. The input files are all the same dimensions and weigh a few hundred to a thousand KB, but the output files are all the same size, around 138 MB. This suggests to me that the mogrified files are being stored uncompressed. Using mogrify *.tif -compress zip leaves the files at their inflated size.
Why is the compression step failing?
Output of magick -version:
Version: ImageMagick 7.1.0-35 Q16-HDRI x64 ff6dbbb:20220516 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenCL OpenMP(2.0)
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg jxl lcms lqr lzma openexr pangocairo png ps raqm raw rsvg tiff webp xml zip zlib
Compiler: Visual Studio 2022 (193231328)
The sequence of commands is important: success was obtained with mogrify -resize 20% -compress lzw *.tif.

How to prevent a dark edge with transparency using montage?

I'm trying to montage some semi-transparent icons into one image using imagemagicks montage tool.
Unfortunately, after every operation with alpha a bit of black is showing everywhere on anti-aliased edges.
For example, these two icons:
and
After issuing
montage 1.png 2.png -background none montage.png
Result in:
I've tried numerous combinations of alpha, background and changing option order and haven't found a way to prevent this. Any idea?
My system is windows 8.1+cygwin, montage version is:
$ montage -version
Version: ImageMagick 6.9.1-3 Q16 x86_64 2015-07-01
http://www.imagemagick.org Copyright: Copyright (C) 1999-2015
ImageMagick Studio LLC License:
http://www.imagemagick.org/script/license.php Features: DPC OpenMP
Delegates (built-in): autotrace bzlib cairo fftw fontconfig freetype
fpx gslib jbig jng jpeg lcms lzma pangocairo png ps rsvg tiff webp x xml zlib
This looks like a version-specific bug, as the given command works fine on ImageMagick 6.9.1-10 and also using:
convert 1.png 2.png +append 3.png

Imagemagick 6.9.1-7 won't convert psd to any format (Yosemite)

When I run this:
/usr/local/bin/convert ~/desktop/myImage.psd ~/desktop/myImage.jpg
I get this error:
convert: no images defined `/Users/User/desktop/myImage.jpg' # error/convert.c/ConvertImageCommand/3230.
Here's my convert -version:
Version: ImageMagick 6.9.1-7 Q16 x86_64 2015-07-06 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
I've tried at least 4 different psd files
I am one on the developers of ImageMagick and this version contains a bug in the PSD reader. We are aware of this bug and it will be fixed in 6.9.1-8.
Upgrade to 6.9.1-8 to address the issue.

Resources