Hi
i just got imagemagick yesterday and i had a question about using it.
I have a jpg image that i want to turn to monochrome, then select a part of the image (probably by using -crop) and then obtain a histogram for the selected part.
Only i am not sure how this can be done. Can anyone please tell me how i can do this in imagemagick??
Thanks
Unnati
format for piping commands in imagemagick
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: format for piping commands in imagemagick
Code: Select all
convert image.jpg +dither -threshold 50% \
-crop 100x100+40+40 +repage \
-format %c histogram:info:-
http://www.imagemagick.org/Usage/files/#histogram
http://www.imagemagick.org/Usage/quantize/#monochrome
http://www.imagemagick.org/Usage/quantize/#threshold
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: format for piping commands in imagemagick
Hi
thanks for that wonderful post...its really helpful
i have one more question though...this command gives me info about the least and the most intense pixels...but how do i get it to actually display the histogram and maybe even display the cropped area??
thanks
unnati
thanks for that wonderful post...its really helpful
i have one more question though...this command gives me info about the least and the most intense pixels...but how do i get it to actually display the histogram and maybe even display the cropped area??
thanks
unnati
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: format for piping commands in imagemagick
For histogram see http://www.imagemagick.org/Usage/files/#histogramunnati wrote:Hi
thanks for that wonderful post...its really helpful
i have one more question though...this command gives me info about the least and the most intense pixels...but how do i get it to actually display the histogram and maybe even display the cropped area??
thanks
unnati
save cropped image:
convert image.jpg +dither -threshold 50% -crop 100x100+40+40 +repage cropped_image.jpg
generate histogram image:
convert cropped_image.jpg histogram:cropped_image_histogram.gif
display cropped image:
display cropped_image.jpg
display histogram of cropped image:
display cropped_image_histogram.gif
I also have an alternate histogram script, histog, at http://www.fmwconcepts.com/imagemagick/index.php
Re: format for piping commands in imagemagick
actually one more question...can i store the output of histogram:info into a .odt file??
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: format for piping commands in imagemagick
I assume an .odt file is open office type document. You will need some type of converter.
If it is a spreadsheet filetype, then use various text utilities to re-format the output into a cvs file that spreadsheet programs can read.
Basically it will be up to open office to provide you with a batch converter for that type of thing. It is well beyond the scope of ImageMagick.
If it is a spreadsheet filetype, then use various text utilities to re-format the output into a cvs file that spreadsheet programs can read.
Basically it will be up to open office to provide you with a batch converter for that type of thing. It is well beyond the scope of ImageMagick.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/