Newbie question:Color modification of photos.

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
drmarie
Posts: 11
Joined: 2010-09-05T10:47:30-07:00
Authentication code: 8675308

Newbie question:Color modification of photos.

Post by drmarie »

I would like to create a webpage where a user can upload a photo and then it gets converted so that they can see what their dog would see.

I have never used ImageMagick but before I go through the learning curve I'd like to make sure this can be done.

What I want to do, for example, is take everything from one part of the color spectrum (i.e. everything from blue to purple) and display it in shades of blue. Then, I want to take other parts of the spectrum and display it in shades of yellow, etc.

Can I do this with IM?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question:Color modification of photos.

Post by fmw42 »

can you post links to an input image and the way you want it to look? (you have to post somewhere else, say some free image serviced and put links here to it). Or do you have a url to some page on the internet that shows that?
drmarie
Posts: 11
Joined: 2010-09-05T10:47:30-07:00
Authentication code: 8675308

Re: Newbie question:Color modification of photos.

Post by drmarie »

Let me see if I can simplify my question...

Is it possible for me to take all of the purple in a photo and change it to blue using imagemagick?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question:Color modification of photos.

Post by fmw42 »

Yes

convert image -fuzz XX% -fill blue -opaque purple result.

This will take all near colors within XX% of pure purple and change them ALL to pure blue.
Last edited by fmw42 on 2010-09-05T16:56:38-07:00, edited 3 times in total.
drmarie
Posts: 11
Joined: 2010-09-05T10:47:30-07:00
Authentication code: 8675308

Re: Newbie question:Color modification of photos.

Post by drmarie »

excellent! thank you.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question:Color modification of photos.

Post by fmw42 »

Also see my script huemap at the link below.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question:Color modification of photos.

Post by fmw42 »

drmarie
Posts: 11
Joined: 2010-09-05T10:47:30-07:00
Authentication code: 8675308

Re: Newbie question:Color modification of photos.

Post by drmarie »

Thanks. I found exactly what I want to do....I want to use to -clut function to replace one spectrum with another. Now I just need to figure out how to use IM via a php script. (I just started a new topic to ask about this.)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Newbie question:Color modification of photos.

Post by fmw42 »

You can create a unix shell script and just call that script from PHP via the exec function. See http://www.rubblewebs.co.uk/index.php for many examples of PHP and IM together. This way you can test your script locally on your own computer and then run it from some server using PHP. The main thing to keep in mind is that in PHP, the convert command usually needs to be prefaced by its full path, typically /usr/local/bin/convert or /usr/bin/convert
Post Reply