Page 1 of 1

Selecting PhotoCD size

Posted: 2007-03-16T08:31:52-07:00
by sacha
A .pcd file (Kodak PhotoCD) potentially has a number of images in it, at different sizes:

192x128
384x256
768x512
1536x1024
3072x2048

By default when you load the PhotoCD file using MagickReadImage(), you get the 768 image. I need to select the largest available (3072 for my images), but don't know how.

I have the following program:

Code: Select all

def main () {
  local w = NewMagickWand()
  MagickReadImage(w, info("argv 1"))
  print(MagickGetImageFormat(w))
  print(MagickGetNumberImages(w))
  print(MagickGetImageWidth(w), "x", MagickGetImageHeight(w))
  DestroyMagickWand(w)
}
It produces the following output:

Code: Select all

PCD
1
768x512
Anyone know how to select something other than the 768?

Re: Selecting PhotoCD size

Posted: 2007-03-16T09:49:14-07:00
by sacha
From a trawl through the source code, it turns out the answer is to specify the geometry before you load the file:

Code: Select all

MagickSetSize(w, 3072, 2048)
MagickReadImage(w, info("argv 1"))
I've verified that this does indeed load the high resolution image rather than upscaling a lower resolution image.

Re: Selecting PhotoCD size

Posted: 2007-03-19T22:08:14-07:00
by anthony
Added this to IM Examples, File Formats
http://www.imagemagick.org/Usage/#pcd