Hi,
I am new to IM and I have a folder with some hundred images that need to be analysed.
I want IM to create copies of these images with the imprinted information of the "indetify -verbose image.tif" output.
How to do that ?
Thanks !!
Imprint Identify output into image
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imprint Identify output into image
You can write text from identify to a file, then use one of the methods shown on http://www.imagemagick.org/Usage/text/ to write the text in that file to an image. For example:
Or you can do this in one step, with piping.
Code: Select all
identify -verbose r.tiff >t.txt
convert r.tiff -background None label:@t.txt -gravity Center -layers merge withtext.tiff
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Imprint Identify output into image
The verbose information is rather long. Where do you want to put that information? In a meta tag such as the comment tag or imbedded onto the pixel data so that it shows in the image? If your image is not very big, that much text may not be readable if imbedded onto the image
Please always provide your IM version and platform, since syntax may differ.
If imbedded, as snibgo shows, then I would use caption: so that it wraps to the size of your image or some specified width and or height rather than label:, which will try to put it all in one line.
Please always provide your IM version and platform, since syntax may differ.
If imbedded, as snibgo shows, then I would use caption: so that it wraps to the size of your image or some specified width and or height rather than label:, which will try to put it all in one line.
Re: Imprint Identify output into image
Thanks,
I am using IM 7 on a Win64 DOS shell.
I want the stats embedded in pixeldata, images are about 5000x5000 pixels.
I guess snibgos solution with caption: will work for me. Will try tomorrow.
I am using IM 7 on a Win64 DOS shell.
I want the stats embedded in pixeldata, images are about 5000x5000 pixels.
I guess snibgos solution with caption: will work for me. Will try tomorrow.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Imprint Identify output into image
label: also works (because that text has line breaks), but you may want to specify a pointsize or the height of the image to the text part so that it is readable as desired.
Perhaps you should post your image to some free hosting service such as dropbox.com and put the URL here so we can access your image to help you further.
Perhaps you should post your image to some free hosting service such as dropbox.com and put the URL here so we can access your image to help you further.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imprint Identify output into image
You may also need other refinements, eg because black text doesn't show clearly against dark images.
snibgo's IM pages: im.snibgo.com
Re: Imprint Identify output into image
Thanks,
works for me perfectly.
This brings me to another question:
How can I embedd a histogram into these images (instead of the identify output) ?
Code: Select all
identify -verbose r.tiff >t.txt
convert r.tiff -background None -size 5000x5000 -fill white -gravity Center label:@t.txt -layers merge withtext.tiff
This brings me to another question:
How can I embedd a histogram into these images (instead of the identify output) ?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Imprint Identify output into image
By "histogram", do you mean the histogram text data, or a histogram image?
h.txt is histogram text data.
h.png is a histogram image.
You can "-composite" an image over another, eg:
("histogram:" is an output coder that writes to a file or pipe, not an option that creates an in-memory image, so we can't read an image, create its histogram image, and composite them together in a single convert command, as far as I can see.)
Code: Select all
convert input.png -define histogram:unique-colors=true histogram:info:h.txt
Code: Select all
convert input.png -define histogram:unique-colors=false histogram:h.png
You can "-composite" an image over another, eg:
Code: Select all
convert input.png h.png -composite out.png
snibgo's IM pages: im.snibgo.com