Getting the color of a specific PNG pixel without using loadImage
in
Programming Questions
•
2 years ago
Hi all...
I have a large collection of PNGs that are cross-sections of a microscopic sample. I want to be able to generate composite images that simulate what a cross-section would have looked like if the slices had been taken through another angle. I figure I should be able to do this by a bit of clever bit of 3-D math, grabbing the rgb value of appropriate pixel of the various pre-existing images, and then using them to draw out a new image.
I worry though that having to load all of the images one at a time via loadImage() just so I can grab the pixel info will be quite slow. I'm wondering if it's possible to just kind of reach into the binary file for each png and read a specific pixel value that way. But I have no idea if that's feasible with the png format (not really knowing anything about how .png files actually store images).
Does anyone have any insight in this? By any miracle is there some sort of function that does this?
Thanks!
I have a large collection of PNGs that are cross-sections of a microscopic sample. I want to be able to generate composite images that simulate what a cross-section would have looked like if the slices had been taken through another angle. I figure I should be able to do this by a bit of clever bit of 3-D math, grabbing the rgb value of appropriate pixel of the various pre-existing images, and then using them to draw out a new image.
I worry though that having to load all of the images one at a time via loadImage() just so I can grab the pixel info will be quite slow. I'm wondering if it's possible to just kind of reach into the binary file for each png and read a specific pixel value that way. But I have no idea if that's feasible with the png format (not really knowing anything about how .png files actually store images).
Does anyone have any insight in this? By any miracle is there some sort of function that does this?
Thanks!
1