I plan to do image analysis on some large TIFF images. These are distributed (by USGS) as High Resolution Orthoimagery (HRO). A typical file might contain 12815 x 14632 (RGBA) pixels.
I'd like to convert these into MPC (Magick Persistent Cache) format, then map them into memory in my own (Elixir) application. However, I haven't been able to find a detailed layout description for MPC. I'd rather not have to reverse engineer this from the IM code base. Suggestions?
-r
detailed layout of MPC format?
-
- Posts: 3
- Joined: 2018-05-03T15:14:46-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: detailed layout of MPC format?
I have no other suggestions. As far as I know, the best documentation is mpc.c. It's a very simple format: some text in the mpc file, and uncompressed pixels in the cache file.
snibgo's IM pages: im.snibgo.com
-
- Posts: 3
- Joined: 2018-05-03T15:14:46-07:00
- Authentication code: 1152
Re: detailed layout of MPC format?
mpc.c is a bit over 1500 LOC; I can work my way through this if need be, but I'd rather avoid that pain. However, if someone familiar with the code is willing to dig out the details, I'd be happy to write up a wiki page, etc.
Re: detailed layout of MPC format?
MPC utilizes the same headers as the MIFF format described @ https://www.imagemagick.org/script/miff.php. The associated .cache file is a direct memory mapping of the image pixels. With IMv7, for example, an RGB image would typically include columns * rows RGB pixel floats. You can memory map the .cache file and get direct access to the pixels from your applications.