Page 1 of 1

Clipping results in empty image on CentOS

Posted: 2020-03-16T05:56:33-07:00
by jd.wiese
Hello!

I'm having a strange problem with the "-clip" command on this image:

https://cloud.netgroup.de/index.php/s/5p8qRJvcSnvi7JF

The following command works perfectly on Windows: (Version: ImageMagick 7.0.1-3 Q16)

imagick.exe convert TDF-M-12SPLICE.tif -alpha transparent -clip -alpha opaque TDF-M-12SPLICE.png
https://cloud.netgroup.de/index.php/s/mzKUZSTbb834Jo7

but on CentOS the same command produces an empty image: (Version: ImageMagick 7.0.10-0 Q16 x86_64)

convert TDF-M-12SPLICE.tif -alpha transparent -clip -alpha opaque TDF-M-12SPLICE.png
https://cloud.netgroup.de/index.php/s/wqPKwxBzMo5e4WU

Althougt the filesize is nearly identical to the one converted on Windows.

Any ideas?

Re: Clipping results in empty image on CentOS

Posted: 2020-04-06T05:51:05-07:00
by jd.wiese
No ideas anyone?

Re: Clipping results in empty image on CentOS

Posted: 2020-04-06T06:27:45-07:00
by snibgo
by jd.wiese wrote:imagick.exe convert ...
Is that really your command, with "i" at the start? Perhaps your command was "magick.exe convert".

For v7, I suggest you use just "magick". Not "magick convert", and not "convert".

When your command has "-clip", I suggest it should always also have "+clip", to turn clipping off after the operation you want it to apply to.

Sorry, I can't yet test with IM v7.0.10.

Re: Clipping results in empty image on CentOS

Posted: 2020-04-06T09:31:58-07:00
by fmw42
Do you have the same SVG rendered on both systems and the same versions? Inkscape, RSVG or MSVG/XML are the possibilities

Re: Clipping results in empty image on CentOS

Posted: 2020-04-06T23:58:35-07:00
by jd.wiese
Thanks for your reply!
snibgo wrote:
2020-04-06T06:27:45-07:00
by jd.wiese wrote:imagick.exe convert ...
Is that really your command, with "i" at the start? Perhaps your command was "magick.exe convert".
That was just a typo, "magick.exe convert" was the command I used :-)
snibgo wrote:
2020-04-06T06:27:45-07:00
For v7, I suggest you use just "magick". Not "magick convert", and not "convert".
OK, thanks for the tip.
snibgo wrote:
2020-04-06T06:27:45-07:00
When your command has "-clip", I suggest it should always also have "+clip", to turn clipping off after the operation you want it to apply to.
I tried this, but it does not make a difference:

magick TDF-M-12SPLICE.tif -alpha transparent -clip -alpha opaque +clip TDF-M-12SPLICE.png

The result is exactly the same :-(

Re: Clipping results in empty image on CentOS

Posted: 2020-04-06T23:59:19-07:00
by jd.wiese
fmw42 wrote:
2020-04-06T09:31:58-07:00
Do you have the same SVG rendered on both systems and the same versions? Inkscape, RSVG or MSVG/XML are the possibilities
How can I verify that?

Re: Clipping results in empty image on CentOS

Posted: 2020-04-07T10:04:09-07:00
by fmw42

Code: Select all

convert -list format
Look at the end of the line for SVG. Does it say RSVG or XML or MSVG. The latter two are the same.

Also

Code: Select all

convert -version
will tell you if you have rsvg listed in the Delegates line.

If you have Inkscape on your system, that will be used in place of either of the other two.

You may have to search your computer to see if you have Inkscape.

Perhaps the best way is to add -verbose right after convert in your command line. That should show which is being used.

Re: Clipping results in empty image on CentOS

Posted: 2020-04-08T07:09:18-07:00
by jd.wiese
fmw42 wrote:
2020-04-07T10:04:09-07:00

Code: Select all

convert -list format
Look at the end of the line for SVG. Does it say RSVG or XML or MSVG. The latter two are the same.
That gives me

Code: Select all

SVG  SVG       rw+   Scalable Vector Graphics (RSVG 2.40.20)
SVGZ  SVG       rw+   Compressed Scalable Vector Graphics (RSVG 2.40.20)
fmw42 wrote:
2020-04-07T10:04:09-07:00

Also

Code: Select all

convert -version
will tell you if you have rsvg listed in the Delegates line.
That gives me

Code: Select all

Version: ImageMagick 7.0.10-0 Q16 x86_64 2020-03-09 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype gslib gvc heic jbig jng jp2 jpeg lcms ltdl lzma openexr pangocairo png ps raqm raw rsvg tiff webp wmf x xml zlib
fmw42 wrote:
2020-04-07T10:04:09-07:00

If you have Inkscape on your system, that will be used in place of either of the other two.

You may have to search your computer to see if you have Inkscape.

Perhaps the best way is to add -verbose right after convert in your command line. That should show which is being used.
Inkscape is not installed, its a CLI-only system.

Code: Select all

convert -verbose TDF-M-12SPLICE.tif -alpha transparent -clip -alpha opaque TDF-M-12SPLICE.png
gives me

Code: Select all

TDF-M-12SPLICE.tif TIFF 2196x3088 2196x3088+0+0 8-bit TrueColor sRGB 2.5054MiB 0.160u 0:00.397
writing raw profile: type=8bim, length=10278
writing raw profile: type=xmp, length=16385
TDF-M-12SPLICE.tif=>TDF-M-12SPLICE.png TIFF 2196x3088 2196x3088+0+0 8-bit sRGB 2.5054MiB 2.720u 0:02.638
convert: Incompatible type for "RichTIFFIPTC"; tag ignored. `TIFFFetchNormalTag' @ warning/tiff.c/TIFFWarnings/1036.

Re: Clipping results in empty image on CentOS

Posted: 2020-04-08T15:51:48-07:00
by fmw42
Inkscape can be installed and used command line. If it is there, ImageMagick will use it in preference to your RSVG, which is rather old. You should either upgrade that or install Inkscape, which is generally better.