Page 1 of 1
Problem converting huge images
Posted: 2011-05-11T02:39:17-07:00
by Skaggivara
Hi I am using imagemagick version 6.6.9-1 on macosx snow leopard, Imac core i7, 2.93ghz, 8gb ram.
I am trying to convert a huge png (8bit RGB 86400x43200) to ppm. I can open the png in photoshop, it seems fine. However when I create a ppm file out of the png it seems to be invalid, meaning I cannot open it in photoshop (gives and error).
I use the following command: "convert huge_normal.png huge_normal.ppm"
The file is created, and no error is thrown but I cannot use the resulting file. Is there a size limit on ppm files? Any other issues I should be aware of?
I need ppm files because I am using mmps (
http://www.users.globalnet.co.uk/~arcus/mmps/)
Thank you!
Re: Problem converting huge images
Posted: 2011-05-11T11:02:06-07:00
by fmw42
Re: Problem converting huge images
Posted: 2011-05-11T12:17:31-07:00
by magick
Photoshop may not support all features of PPM. Does the first few lines of the PPM suggest the image remains in 8-bits or is it 16? The max value should be 255 rather than 65535. Can ImageMagick read the PPM. Try
- identify -verbose image.ppm
Be patient. It may take some time for the command to respond ('cause its so huge).
Re: Problem converting huge images
Posted: 2011-05-16T06:12:51-07:00
by Skaggivara
Format: PPM (Portable pixmap format (color))
Class: DirectClass
Geometry: 43200x21600+0+0
Resolution: 72x72
Print size: 600x300
Units: Undefined
Type: TrueColor
Endianess: Undefined
Colorspace: RGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 127.913 (0.501619)
standard deviation: 30.4004 (0.119217)
kurtosis: 5.8757
skewness: -0.0165218
Green:
min: 0 (0)
max: 255 (1)
mean: 126.475 (0.495979)
standard deviation: 30.3162 (0.118887)
kurtosis: 5.29629
skewness: -0.298521
Blue:
min: 96 (0.376471)
max: 255 (1)
mean: 230.418 (0.903602)
standard deviation: 41.3215 (0.162045)
kurtosis: 0.425264
skewness: -1.41602
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 161.602 (0.633733)
standard deviation: 34.4031 (0.134914)
kurtosis: 17.2632
skewness: 2.43846
Rendering intent: Undefined
Interlace: None
Background color: white
Border color: rgb(223,223,223)
Matte color: grey74
Transparent color: black
Compose: Over
Page geometry: 43200x21600+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2011-05-11T16:23:06+02:00
date:modify: 2011-05-11T16:23:06+02:00
signature: 42a7a5da9dee9358e460993b6bd1ecdbdb0c5a283f08b62a02e10d3dcd665db9
Artifacts:
verbose: true
Tainted: False
Filesize: 2.7994GBB
Number pixels: 933.1MB
Pixels per second: 8.966MB
User time: 6.640u
Elapsed time: 1:45.069
Version: ImageMagick 6.6.9-1 2011-05-09 Q16
http://www.imagemagick.org
this is what I get for identify -verbose on a 43200x21600 pixel image converted to ppm from png. Does not look like there is something wrong?
Re: Problem converting huge images
Posted: 2011-05-16T06:25:58-07:00
by magick
ImageMagick is creating the PPM image properly. Photoshop most likely has a bug. Post a URL to you image so we can download it. We'll verify it meets the PPM image specification. If so, the problem lies with Photoshop.
Re: Problem converting huge images
Posted: 2011-05-16T17:47:34-07:00
by anthony
magick wrote:Photoshop may not support all features of PPM. Does the first few lines of the PPM suggest the image remains in 8-bits or is it 16? The max value should be 255 rather than 65535. Can ImageMagick read the PPM. Try
- identify -verbose image.ppm
Be patient. It may take some time for the command to respond ('cause its so huge).
This will get the info faster...
head -n3 image.ppm
The first four words (generally over 3 lines) is: "P3" or "P6", widith, height, value_range
and the rest is purely image data (generally in raw binary).
However be warned that PPM images can have ANY value_range setting from 1 to 65535. It is not limited to 8 or 16 bit depth quality, though they are typically stored in that range. Imagemagick can only generate PPM images with 8 or 16 bit quality.
Re: Problem converting huge images
Posted: 2011-07-20T13:30:29-07:00
by andreaplanet
If the PPM has binary raw values then you can load it in Photoshop using the RAW PlugIN. Rename the file into .RAW then when you open it in Photoshop enter the correct values for size, count (3 for RGB), interleaved checked, and at last you must set the Header to the size of the initial header of the PPM file.
Re: Problem converting huge images
Posted: 2011-07-20T18:00:22-07:00
by anthony
If photoshop allows it (and it should) you should also be allow to gzip the ppm file. The PbmPLus library understand gzipped forms of PPM images directly, and so does ImageMagick (through a different technqiue) However this will not help with a out of memory problem.
PPM images are typically used so that you can design 'streaming' methods of image processing, that have a much smaller memory foot print. However not all image processing can be performed using streaming methods, and in that case images are typically broken up into tiles for processing.