(index ("write-png" 0) ("write-jpg" 0) ("write-tga" 0) ("write-bmp" 0))
(def (sig (procedure " (write-png pixels width height components #!key flip compression stride filter)" (id write-png)) (procedure " (write-jpg pixels width height components #!key flip quality)" (id write-jpg)) (procedure " (write-tga pixels width height components #!key flip rle)" (id write-tga)) (procedure " (write-bmp pixels width height components #!key flip)" (id write-bmp))) (p "Writes the u8vector " (tt "pixels") " to " (tt "(current-output-port)") " using the image format of the procedure name. The pixel format depends on " (tt "components") ", which represents the number of bytes per pixel:") (pre "   1: y8 (gray)\n   2: ya16 (gray + alpha)\n   3: rgb24\n   4: rgba32") (p "Extra parameters are:") (ul (li (tt "flip") " specifies whether to flip the image vertically before outputting") (li "png " (tt "compression") " sets the " (tt "zlib") " compression quality. defaults to 8, try higher values for more compression") (li "png " (tt "stride") " is the distance in bytes from the first byte of a row of pixels to the first byte of the next row of pixels.") (li "png " (tt "filter") " forces a particular " (link "https://en.wikipedia.org/wiki/Portable_Network_Graphics#Filtering" "filter type") " for all scanlines. defaults to trying all and picking the most efficient (" (tt "#f") "), other valid values are 0-4.") (li "jpg " (tt "quality") " specifies lossy compression amount as a percentage (defaults to 80)") (li "tga " (tt "rle") " enables or disable run-length-encoding compression. it is on by default, set to " (tt "#f") " to disable rle compression")) (p "Note that on 32-bit systems, blobs cannot be larger than 16M. This also limits image sizes as pixel data is stored in a blob."))
