Is there a way to specify the dimensions of an image using inches and not pixels? Seems too confusing to convert pixels to inches.
This is the first step in creating a label.
Thanks!
How do I create an 8" x 3.5" box?
-
- Posts: 19
- Joined: 2011-01-10T12:25:14-07:00
- Authentication code: 8675308
Re: How do I create an 8" x 3.5" box?
I would say not.
The thing is that everything else you do in Imagemagick will be in pixels anyway so how would you work around that ?
The thing is that everything else you do in Imagemagick will be in pixels anyway so how would you work around that ?
Code: Select all
convert -density 75 -size 600x263 xc:black test_density.jpg
-
- Posts: 19
- Joined: 2011-01-10T12:25:14-07:00
- Authentication code: 8675308
Re: How do I create an 8" x 3.5" box?
yeah, that makes sense. So, how then would I make the dimensions so that they would equal 8" x 3.5"?
Getting this specific dimension is primary to starting my project as this will be the label size required. I've read that the pixel to inches conversion will be different depending on the dpi(dots per sq inch). Do you know a way to get clarity on this?
Getting this specific dimension is primary to starting my project as this will be the label size required. I've read that the pixel to inches conversion will be different depending on the dpi(dots per sq inch). Do you know a way to get clarity on this?
Re: How do I create an 8" x 3.5" box?
My example code above gives a box of 8"x 3.507"
Set the DPI using -density - I think it needs defining before the size - then the size in pixels.
8" * 75dpi = 600px
3.5" * 75dpi = 262.5px
Set the DPI using -density - I think it needs defining before the size - then the size in pixels.
8" * 75dpi = 600px
3.5" * 75dpi = 262.5px
-
- Posts: 19
- Joined: 2011-01-10T12:25:14-07:00
- Authentication code: 8675308
Re: How do I create an 8" x 3.5" box?
that looks great. I'm trying to draw a black outline around the inside of the box using the draw command. Here is what I came up with and it is telling me "unable to open image" and "no decode delegate for this image format".
convert -density 75 -size 600x263 xc:white -fill white -stroke black \ -draw "rectangle 590x253" draw_rect.jpg
I think that my rectangle dimensions are not in the right format?
convert -density 75 -size 600x263 xc:white -fill white -stroke black \ -draw "rectangle 590x253" draw_rect.jpg
I think that my rectangle dimensions are not in the right format?
Re: How do I create an 8" x 3.5" box?
How are you using your code php, batch, bash etc?
You need to check out my site as I have links to most of the operators under the basics section or the IM example section: http://www.imagemagick.org/Usage/
Code: Select all
convert -density 75 -size 600x263 xc:white -fill white -stroke black -strokewidth 10 -draw "rectangle 50,50 550,213" draw_rect.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How do I create an 8" x 3.5" box?
Inches are printing units and depend upon the density or resolution you set. So you need to set the density and then figure out how many pixels on a side that would correspond to. IM does not use drawing units of inches only pixels to my knowledge.
-
- Posts: 19
- Joined: 2011-01-10T12:25:14-07:00
- Authentication code: 8675308
Re: How do I create an 8" x 3.5" box?
I am using the bash shell.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: How do I create an 8" x 3.5" box?
-draw "rectangle 590x253" should be -draw "rectangle ULX,ULY BRX,BRY"
that is you must tell the draw commands the upperleft and bottomright coordinates and not the WIDTHxHEIGHT
see http://www.imagemagick.org/Usage/draw/#primitives
see Bonzo's command above. That should work in a bash shell as it is just one command line or it can be run from PHP exec command.
that is you must tell the draw commands the upperleft and bottomright coordinates and not the WIDTHxHEIGHT
see http://www.imagemagick.org/Usage/draw/#primitives
see Bonzo's command above. That should work in a bash shell as it is just one command line or it can be run from PHP exec command.