Need help overlaying gradient map and batch editing images

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
snowman4
Posts: 1
Joined: 2020-01-28T16:24:59-07:00
Authentication code: 1152

Need help overlaying gradient map and batch editing images

Post by snowman4 »

Hello all! I am batch editing some video game textures to make them more of a pinkish hue and was told that Image Magick was the best application to use for it. Basically I want to get the base image, apply a gradient map to it and then overlay that over the original image (as demonstrated below) and then do the same thing for every other image I need to do this on.
ImageImageImage

Any idea where I should start with all this? Cheers

User avatar
fmw42
Posts: 26268
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help overlaying gradient map and batch editing images

Post by fmw42 »

What is your ImageMagick version and platform? Assuming Unix-like (not Windows), try the following. It makes a pink image from a clone of the input. Then it makes a grayscale version of the input and uses that as a mask. Then composites (-compose overlay) the 3 images.

Code: Select all

convert img.png \( -clone 0 -fill pink -colorize 100 \) \( -clone 0 -colorspace gray \) -compose overlay -composite result.png
This should look similar to your last image.

See
https://imagemagick.org/Usage/compose/#compose
https://imagemagick.org/Usage/compose/#overlay
https://imagemagick.org/Usage/basics/#parenthesis
https://imagemagick.org/Usage/basics/#clone

For Novices see:
http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Post Reply