|Perl: the Markov chain saw|
working with png databy Anonymous Monk
|on Sep 09, 2019 at 09:49 UTC||Need Help??|
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I read a png file and want to work with the image data, A set of colors I consider as foreground all others as background. I convert the png data into a string of 0/1s and store them as one string per line (@sw)
I have two slow working versions ....
My first try was to read out every pixel-color:
But this was really, really slow.
The next try was to use GD::wbmp. It is much faster, but for several foreground-colors this seems far away from optimum.
Do you have a better(faster) idea, to convert the png data to a 0/1 bit stream by using the color definition in @col ?
Thanks for your help !!!