Re: [GM-help] understanding Magick::ImageType with indexed images
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Carnë D. <car...@gm...> - 2013-07-31 10:54:10
|
On 18 July 2013 20:10, Bob Friesenhahn <bfr...@si...> wrote: > On Thu, 18 Jul 2013, Carnė Draug wrote: >> >> So there's absolutely no way to find this? Not even an ugly hack? Or >> would it be possible for me to implement a method in GraphicsMagick to >> do so? If so, could you give me some pointers about where I should >> look? > > > Each coder module (around 100 of them already) deciphers the input image > based on its knowledge of the format. If the input file contains multiple > frames, then is it possible that the frames are of different types so a > whole-file value would not work. The information would need to be at the > per-frame level. > > I don't know of a way to solve this other than to update all of these coder > modules to add an attribute to the image which indicates what the original > format is. > > Alternatively, an option could be added to force never promoting monochrome > and grayscale images to PseudoClass. This might require writing new decode > logic because the existing implementation might only be via PseudoClass. I see the advantage of why GM might be doing this, it can reduce memory usage a lot and it's really smart. I'd just really need a method to get information on the original image. >> Octave is using GraphicsMagick as the library to read and write >> images, and we need to always returns the image as its stored in the >> file, indexes or actual color values. Could you give me advice on the >> best work this out? > > > One way would be to do the work to produce a source patch for GraphicsMagick > to add this information. This would require some detailed work and research > into the details of each file format. I have looked into this and it's more work than what I can contribute at the moment. I'm sorry. This issue does not seem to arise very often, so I'll check the coder and if it's JPEG always treat it was DirectClass. I understand that it won't always work but I can't fix this the right way (which is in GM) right now. Thank you, Carnë |