QUERY_PNG is a method of obtaining information about a PNG image file without having to read the file. See QUERY_* Routines for more information.
When an image is read by READ_PNG, it is scaled to the sBIT value, if it is provided in the file. The sBit provides the actual bit depth, which can be different from the "bit depth" byte. See www.w3.org/TR/PNG-Chunks.html for more information.
Query included in creating RGBA (16-bit/channel) and Color Indexed
rgbdata = UINDGEN(4,320,240)
red = indgen(256)
green = indgen(256)
blue = indgen(256)
tempdir = GETENV('IDL_TMPDIR')
; Query and Read the data:
names = [tempdir+'rgb_image.png',$
FOR i=0,N_ELEMENTS(names)-1 DO BEGIN
ok = QUERY_PNG(names[i],s)
img = READ_PNG(names[i],rpal,gpal,bpal)
img = READ_PNG(names[i])
PRINT,names[i],' is not a PNG file'
Result = QUERY_PNG ( Filename [, Info] )
This routine returns a long with the value of 1 (one) if the query was successful (and the file type was correct) or 0 (zero) on failure.
A scalar string containing the pathname of the PNG file to query.
Returns an anonymous structure containing information about the image in the file. The Info.TYPE field will return the value ‘PNG’.
Note: See General Query * Routine Info Structures for detailed structure information.
This page has no user notes yet. Be the first one!