Page 2 of 2

Re: Remove green background

Posted: 2019-05-03T10:14:20-07:00
by sooN
I used the -b white and the commands shown in your example, I actually believe it doesn't work properly on my side.

There's an example photo : http://image.noelshack.com/fichiers/201 ... cn1299.jpg ( too large for this website )

Re: Remove green background

Posted: 2019-05-03T10:15:57-07:00
by fmw42
I want your input, so I can try to process it. This forum does not permit image upload. You have to upload elsewhere and put the URL here as you have done.

Re: Remove green background

Posted: 2019-05-03T11:18:45-07:00
by sooN
Yeah, I don't know what happened with my brain, I wanted to give you the original but... :D

There it is : http://image.noelshack.com/fichiers/201 ... cn1299.jpg

Re: Remove green background

Posted: 2019-05-03T11:40:28-07:00
by fmw42
What you saw as gray was the transparent regions.

Here is what I get:

Input:
Image

White background:

Code: Select all

greenscreen -b white 1556907464-dscn1299.jpg 1556907464-dscn1299_result.jpg
Image


Default Transparent background (which looks gray if viewed by itself):

Code: Select all

greenscreen 1556907464-dscn1299.jpg 1556907464-dscn1299_result.png

or

greenscreen -b none 1556907464-dscn1299.jpg 1556907464-dscn1299_result.png
Image

Re: Remove green background

Posted: 2019-05-03T12:04:50-07:00
by sooN
Yeah, so it doesn't work on my server, I can't tell why, I either have a fully white picture or this if I switch << -b white >> to << -b none >> :

Image

Re: Remove green background

Posted: 2019-05-03T12:27:15-07:00
by fmw42
What is your Imagemagick version and date of the version and platform/OS?

If on IM 6, then

Code: Select all

convert -version 
or if IM 7, then

Code: Select all

magick -version
A guess is that your server is too old for the connected components processing. I can make a version that does not use that, if we find that is the case.

Re: Remove green background

Posted: 2019-05-03T12:34:10-07:00
by fmw42
Download the script again. I made a change and use -a 0. That will disable the connected components part of the script.

Code: Select all

greenscreen -a 0 -b none 1556907464-dscn1299.jpg 1556907464-dscn1299_result.png

or

greenscreen -a 0 -b white 1556907464-dscn1299.jpg 1556907464-dscn1299_result.jpg

Re: Remove green background

Posted: 2019-05-04T05:18:16-07:00
by sooN
I can't tell which version is installed on my server but I updated your script and did that << greenscreen -a 0 -b white >> and there's no change on the image.

Edit: It works now with << greenscreen -t 22 -a 0 -b white >>. I need to try this more but it looks fine for at least one image.

https://paste2.org/ULmNC4Kh

Re: Remove green background

Posted: 2019-05-04T10:47:06-07:00
by fmw42
Your version 6.8.9.9 is prior to -connected-components. I would suggest that you upgrade if possible. That version is about 140 versions old.

Posted: 2019-05-04T10:53:49-07:00
by sooN
Sadly I can't upgrade it, I have like the a very basic hosting, i'm glad ImageMagick is even installed.