Page 3 of 4

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T14:25:09-07:00
by niyanwen
these two commands
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-07T14:50:46-07:00
by fmw42
These two command do not involve the same input/output images. So please clarify the exact commands you used with proper file names to make the output you say is bad. Why are you resizing to the same size as the input -- 4500x4500 -- was the size of the input.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T14:51:49-07:00
by snibgo
Those two commands take two inputs and make two outputs.

You have linked to only one input and one output.

So, which command made that output from that input?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T15:04:20-07:00
by niyanwen
so original image is like image a, c is output image

convert a.png -resize 4500x5400! b.png
convert b.png -trim +repage -bordercolor none -border 5 c.png

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T15:06:55-07:00
by fmw42
Why do you need two commands? You can make it just one and save writing an extra image to disk. Where is it failing? Look at the tmp files in my command.

Code: Select all

convert a.png -resize 4500x5400! +write tmp1.png -trim +repage +write tmp2.png -bordercolor none -border 5 result.png
If it works fine in IM 7, then just use IM 7. But when I ask a question, please answer it. Is your libpng the same in IM 7 as IM 6?

Why are you resizing to the same size as your input?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T15:17:57-07:00
by niyanwen
The thing is IM7 is slower than IM6 looks like 5x slower, we cannot afford it, I suspect it is becasue HDRI enabled?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T17:11:39-07:00
by niyanwen
oh sorry I found the second command I am using is this one
convert /var/folders/g0/tbbcb38x57j_lk7l__b7fgjxw39ddj/T/trim-image-src79649733683580374.png -format %@ -write info: -trim +repage -bordercolor none -border 5 /var/folders/g0/tbbcb38x57j_lk7l__b7fgjxw39ddj/T/trim-image-dest8416507457673086321.png

does this matter with the color things?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T17:34:53-07:00
by fmw42
Please show the exact commands for both commands. Answer our questions properly.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T17:58:08-07:00
by niyanwen
so this is first command:
convert a.png -resize 4500x5400! b.png
this second command:
convert b.png -format %@ -write info: -trim +repage -bordercolor none -border 5 c.png

the input image I put is a.png and output is c.png, scaling size is dynamic and pass from input, it can be 4500x5400 later it can be 3500x5400

libpng version is same as I put in the other post, is there anything else you want to know?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T18:53:07-07:00
by fmw42
If your libpng is the same on IM 6 and IM 7, then I do not know what else might cause it other than some issue with your IM 6 release.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T20:17:27-07:00
by niyanwen
last time you talked about lcme, looks IM6 doesn't have lcme and IM7 has, does that matter?

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T20:45:52-07:00
by fmw42
snibgo said it did not matter since you did not apply a profile to your result. But you could just try adding an sRGB profile to your input and result and see if that helps.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-07T22:44:33-07:00
by niyanwen
think it over I believe the bug happened in this command, sorry make you guys confused since our java application are using two commands together
convert b.png -format %@ -write info: -trim +repage -bordercolor none -border 5 c.png

the use case is I need to trim the transparency out of the image and get the offset, if there is any other command you guys can suggest? otherwise the only option for me is try using IM7

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-08T09:29:55-07:00
by fmw42
I do not understand. Your command works fine for me.

Code: Select all

convert b07s8dt2vc-large-front_image.png -resize 4500x5400! -format %@ -write info: -trim +repage -bordercolor none -border 5 result.png
3739x5194+452+57

It gives the offsets.

Re: Image looks different after removing transparent space and scaled

Posted: 2019-10-08T10:56:13-07:00
by niyanwen
oh the offset is correct, the bug I mean is the output is different, as I mentioned earlier in this post, there is transparency in the original pic but in the output these transparency are missing, the transparaency I men is on the image, like black ranger in the pic with IM6
original: https://drive.google.com/open?id=1ufx2A ... XZMolPcnf1
output: https://drive.google.com/open?id=122q_p ... mGJcV0XuFz