Code: Select all
convert 001.jpg -colorspace gray out.jpg
please help me
Code: Select all
convert 001.jpg -colorspace gray out.jpg
sorry,I don't understand,I am usingImagemagick 7,How to use commands to change the color of grayscale imagesfmw42 wrote: ↑2019-01-29T21:53:36-07:00 Imagemagick 6 internally treats grayscale images as 3 equal RGB channels. To outside programs it is actually only one channel. For example:
convert logo: -colorspace gray x.jpg
exiftool -s -ee -g1 -u -n -D x.jpg
---- ExifTool ----
- ExifToolVersion : 10.51
---- System ----
- FileName : x.jpg
- Directory : .
- FileSize : 34253
- FileModifyDate : 2019:01:29 20:51:46-08:00
- FileAccessDate : 2019:01:29 20:51:46-08:00
- FileInodeChangeDate : 2019:01:29 20:51:46-08:00
- FilePermissions : 644
---- File ----
- FileType : JPEG
- FileTypeExtension : JPG
- MIMEType : image/jpeg
- ImageWidth : 640
- ImageHeight : 480
- EncodingProcess : 0
- BitsPerSample : 8
- ColorComponents : 1
---- JFIF ----
0 JFIFVersion : 1 1
2 ResolutionUnit : 0
3 XResolution : 1
5 YResolution : 1
---- Composite ----
- ImageSize : 640x480
- Megapixels : 0.3072
Imagemagick 7, internally treats grayscale images as one single channel.
In Imagmagick 7, doing your command should make a single channel grayscale image.The next,I need to convert it to a single channel color image, what should I do?
fmw42 wrote: ↑2019-01-30T00:24:12-07:00 What do you mean by change the color of grayscale images? Do you want to colorize them? Or do you want to make the grayscale image become 3 channels RGB format?
Your question was:
In Imagmagick 7, doing your command should make a single channel grayscale image.The next,I need to convert it to a single channel color image, what should I do?
______________________
Please, always provide your IM version and platform when asking questions, since syntax may differ.
Also provide your exact command line and your images, if possible.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at viewtopic.php?f=1&t=9620
If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli
For novices, see
viewtopic.php?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
Code: Select all
magick grayscale.png +level-colors "red,white" colored.png
fmw42 wrote: ↑2019-01-30T10:43:30-07:00 try this
see https://imagemagick.org/Usage/color_mods/#level-colorsCode: Select all
magick grayscale.png +level-colors "red,white" colored.png