There are two possible representations of transparency in PNG files: alpha channel for :truecolor-alpha and :greyscale-alpha colour types, and a separate transparency map in a tRNS ancillary chunk. PNG-READ retains the difference by keeping data from tRNS as a separate TRANSPARENCY property of png-state. New version of OPTICL:READ-PNG-STREAM uses transparency data for OPTICL alpha channel when reading a PNG with no "native" alpha channel implied by colour-type. Additionally, as OPTICL has no equivalent for :greyscale-alpha, greyscale images with (any kind of) transparency data are converted to RGBA. Due to a bug in PNG-READ (fix committed on pull request <Ramarren/png-read#3), PNG-READ::TRANPARENCY property contained a raw representation of tRNS ancillary chunk instead of 2D 8-bit transparency data (that's how it was intended to work). A workaround for unfixed PNG-READ was added to this version of OPTICL:READ-PNG-STREAM: If TRANSPARENCY is not a 2D-array, its content is ignored (as if there were no alpha channel). Warning or error could be more appropriate here. Turning :greyscale-alpha colour type to RGBA is an example of new use cases supported by rewritten READ-PNG-STREAM, even with older PNG-READ.
…uire :sb-cltl2) which fixes compilation on recent SBCLs.
… (simple-array fixnum (*)) counts)
… silence SBCL's compiler notes
…undant and slightly-misleading (but, thankfully, not exported) integer-image and float-image
…specific differences in how type declarations are dealt with. also, cleaner evaluation of check for channels and that channels is > 1 in the image constructor function template.
…xecute. Thanks to Utz-Uwe Haus for the patch.
…age type and using this with :element-type as appropriate
…b, and 8- and 16-bit rgba
…sharpen-kernel* be of element-type 'double-float
…e-float array, add &key element-type arg to normalize-array
…back from things like normalize.
* compute-histogram now uses double-float instead of single-float * both are with docstrings * threshold-image-with-min-error signals a type if an image of unsupported type was passed * several numeric bugs were fixed
…d J. Illingworth Though, somewhat buggy (for example, DIVISION-BY-ZERO happens sometimes), but still useful. It will be improved very soon.