Page 2 of 4

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T03:29:56-07:00
by snibgo
niyanwen wrote: I am new to image processing, could you recommend what's the right way to view it? like by which software?
There is no "right" way. Images with transparency are always shown flattened against some background. A chequerboard background is traditional because it clearly shows which areas of the image are entirely transparent. But it creates viewing problems when the image has areas that are only slightly transparent.

In Gimp, Edit | Preferences | Display can change transparency from checks to solid white, gray or black. Or Image |Flatten image will remove transparency.

Gimp's Color Picker can show RGBA values for individual pixels. This clearly shows that your images have areas of constant colour (RGB channels) but varying transparency (alpha channel).

Personally, I mostly use Microsoft Photo Viewer, and my own unpublished image editor. But Gimp can do the job.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T11:35:19-07:00
by niyanwen
Hi,

this is my scale command, I scale it first then trim the transparency on the border
convert a.png -resize 4500x5400! b.png

PNG version is related to ImageMagick version or not? since I work for industry, current image magick version is the widely used version our company

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T11:54:45-07:00
by niyanwen
@snibgo

yeah looks like alpha channel value is different after image magick processed, because of this difference could we consider it as different?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T13:42:13-07:00
by fmw42
I cannot see any visual difference when I use

Code: Select all

convert img.png -resize 4500x5400! img_scale6.png
magick img.png -resize 4500x5400! img_scale7.png
Between these two nor between either and the original

IM 6.9.10.67 and 7.0.8.67 Mac OSX with libpng 1.6.36

Use

Code: Select all

convert -list format
to check which version of libpng.

Use

Code: Select all

convert -version
for your ImageMagick version and date.

If on IM 7 change convert to magick

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T20:26:16-07:00
by niyanwen
when I run convert -list format, I got
PNG* rw- Portable Network Graphics (libpng 1.6.28)
See http://www.libpng.org/ for details about the PNG format.
PNG00* rw- PNG inheriting bit-depth, color-type from original if possible
PNG24* rw- opaque or binary transparent 24-bit RGB (zlib 1.2.11)
PNG32* rw- opaque or transparent 32-bit RGBA
PNG48* rw- opaque or binary transparent 48-bit RGB
PNG64* rw- opaque or transparent 64-bit RGBA
PNG8* rw- 8-bit indexed with optional binary transparency

when I run convert -version, this is what I got
Version: ImageMagick 6.9.4-1 Q16 x86_64 2019-09-29 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib freetype jng jpeg png tiff xml zlib

so you mean i might need to upgrade image magick version or libpng version?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-05T20:50:20-07:00
by fmw42
Your Imagemagick is ancient by version number, though currently patched supposedly on 9/29/2019. So just a couple of weeks ago. But Linux distributions often only patch for security. So it is possible there is a bug or a missing update. But I would start with upgrading your libpng, if you can. The version I used is 1.6.36 and yours is 1.6.28. So your version is 8 releases old. See if your Hosting provider can simply upgrade libpng.

Your list of delegates is missing lcms. That is needed for good color control. So perhaps that could be an issue. Have your hosting provider install that into ImageMagick as well. See http://www.littlecms.com and https://imagemagick.org/download/delegates/

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T11:35:53-07:00
by niyanwen
Since this version 6.xxx is widely used in our company and is recommended, I would not like to change until it is needed

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T11:49:35-07:00
by niyanwen
so my question is there is no way to modify the command to fix this right?
the only way to fix it is update my image magick version?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T12:23:21-07:00
by fmw42
Did you try upgrading libpng? Did you try installing lcms?

This is my command and result:

Code: Select all

convert b07s8dt2vc-large-front_image.png -resize 3500x3500^ b07s8dt2vc-large-front_image_resize.png
http://www.fmwconcepts.com/misc_tests/b ... resize.png

If this looks correct, then try what I suggest above.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T13:29:18-07:00
by snibgo
niyanwen wrote:so my question is there is no way to modify the command to fix this right?
the only way to fix it is update my image magick version?
What exactly needs fixing? Please link to input/output images that you think are wrong, with the command you used.

The images you have linked don't use profiles, so I doubt that LCMS will make any difference.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T13:32:38-07:00
by niyanwen
Hi, @snibog
so the thing is in some certain place the alpha channel value is different, the original image has some transparency

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T13:55:11-07:00
by snibgo
Please link to input/output images that you think are wrong, with the command you used.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T13:57:50-07:00
by niyanwen
original image: https://drive.google.com/open?id=1ufx2A ... XZMolPcnf1
output image: https://drive.google.com/open?id=122q_p ... mGJcV0XuFz

convert img.png -resize 4500x5400! img_scale6.png
convert shirt.png -trim +repage -bordercolor none -border 5 shirt3.png

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T13:59:13-07:00
by niyanwen

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T14:23:07-07:00
by snibgo
Which of those two commands did you use to make that output from that input?