Hi,
i wanted to automate something that i am currently doing manually in gimp-lisanet (Gimp for MacOS with some Addons). I just realised that this version is using some Add-Ons that i can't find in the new version of gimp, so i just wanted to write a shell script with imagemagick:
I have a pdf that i convert to a png and wanted to apply the following:
1) Color to transparancy (white) Everthing that is white becomes transparent //I'm not sure what this gimp-lisanet addon does exactly
2) Invert the image (0,255,255) -> (255,0,0) etc.
3) Add another layer (black) with 66% opacity
4) move the layer to the background of the original image
When i tried to implement this i already failed at 1) and 2). And I have no idea how to do a background layer
Original: https://ibb.co/v3YvMzJ
After Step 1: https://ibb.co/5ng9LSM
After Step 2: https://ibb.co/f1KfCk4
After Step 3: https://ibb.co/8dSyn0p
thanks
png inverting colors - remove white - adding transparent background
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: png inverting colors - remove white - adding transparent background
I see nothing wrong with your steps. They all do what you want them to do as per your description. What is wrong?
Please always provide your ImageMagick version and platform and your code and a proper result if possible.
This is what I think you want, but have no way to know if it is what you got from GIMP.
Unix Syntax:
Adjust the fuzz value to help with anti-aliasing and dark borders around the white letters.
Please always provide your ImageMagick version and platform and your code and a proper result if possible.
This is what I think you want, but have no way to know if it is what you got from GIMP.
Unix Syntax:
Code: Select all
convert Bildschirmfoto-2019-03-11-um-18-10-45.png -alpha off \
-fuzz 10% -transparent white \
-negate \
\( +clone -fill black -colorize 100 -alpha set -channel alpha -evaluate set 66% +channel \) \
+swap -compose over -composite \
Bildschirmfoto_result.png
Re: png inverting colors - remove white - adding transparent background
the image posted are from gimp (what it should look like)
The first step seems to work (-alpha on -fuzz 5% -transparent white)
The second step (-negate) removes all colors, makes all text unreadable, blurs lines etc. What am i doing wrong here?
https://ibb.co/JcbLJgG
MacOS 10.13.6 ImageMagick 7.0.8-6 Q16 x86_64 (current homebrew version)
The first step seems to work (-alpha on -fuzz 5% -transparent white)
The second step (-negate) removes all colors, makes all text unreadable, blurs lines etc. What am i doing wrong here?
https://ibb.co/JcbLJgG
MacOS 10.13.6 ImageMagick 7.0.8-6 Q16 x86_64 (current homebrew version)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: png inverting colors - remove white - adding transparent background
For IM 7, my code above needs -channel rgb added before -negate.
Code: Select all
magick Bildschirmfoto-2019-03-11-um-18-10-45.png -alpha off \
-fuzz 10% -transparent white \
-channel rgb -negate \
\( +clone -fill black -colorize 100 -alpha set -channel alpha -evaluate set 66% +channel \) \
+swap -compose over -composite \
Bildschirmfoto_result7.png
Re: png inverting colors - remove white - adding transparent background
thank you so much. I still need to fiddle with the parameters, but generally it does what it is supposed to.