Hello,
I'm a beginner user of MagickWand, and also image processing.
I do have grayscale jpeg images that that I would like to 'colorize', i.e. instead of current grayscale I would want a blue, red or perhaps a magenta 'scale'.
Do I need to iterate over individual pixels, or perhaps there is an API function that can do this?
Best Regards,
tk
GrayScale to Color
-
- Posts: 3
- Joined: 2017-05-11T16:20:59-07:00
- Authentication code: 1151
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: GrayScale to Color
In command line, you could use -fill red -colorize 50% or some other percent less than 100% and greater than 0%. I do not know magickwand or any API, but there is likely an equivalent command. See http://www.imagemagick.org/api/magick-i ... orizeImage
-
- Posts: 1015
- Joined: 2005-03-21T21:16:57-07:00
Re: GrayScale to Color
I'd suggest you first try modifying one of your images using the IM command line. Anthony has several sections about this kind of operation. For example, see the four subsections which start with
Sepia Tone
and then the whole section here:
Recoloring Images with Lookup Tables
Try those methods and if you find a technique that gives you what you want, then you can look at converting the command line into MagickWand code. Whether you will need to iterate over all the pixels depends upon what method is required to achieve the result you want.
Pete
Sepia Tone
and then the whole section here:
Recoloring Images with Lookup Tables
Try those methods and if you find a technique that gives you what you want, then you can look at converting the command line into MagickWand code. Whether you will need to iterate over all the pixels depends upon what method is required to achieve the result you want.
Pete
Sorry, my ISP shutdown all personal webspace so my MagickWand Examples in C is offline.
See my message in this topic for a link to a zip of all the files.
See my message in this topic for a link to a zip of all the files.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: GrayScale to Color
Most operations at the command line have an equivalent function in both MagickWand and MagickCore. Some command-line operations need calls to a small number of functions.
When designing an image process, it is generally easiest to prototype at the command line. When that does what you want, you can translate it to a program, if you want.
When designing an image process, it is generally easiest to prototype at the command line. When that does what you want, you can translate it to a program, if you want.
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2017-05-11T16:20:59-07:00
- Authentication code: 1151
Re: GrayScale to Color
Thanks for this reply. I'll check it out and get back with result!fmw42 wrote: ↑2017-05-11T17:21:39-07:00 In command line, you could use -fill red -colorize 50% or some other percent less than 100% and greater than 0%. I do not know magickwand or any API, but there is likely an equivalent command. See http://www.imagemagick.org/api/magick-i ... orizeImage
Thanks,
tk
-
- Posts: 3
- Joined: 2017-05-11T16:20:59-07:00
- Authentication code: 1151