CImage:Byteswap
The Byteswap method swaps the byte within the image pixels.
bResult = CImage:Byteswap()
The Byteswap operation can be needed when exchanging images across different computer architecture that store numbers with opposite byte orders.
The following script fragment loads an image from the file sPath, swaps the pixel byte order, and saves the result back to the file:
I = CImage:new() |
-- create a new CImage |
I:Open(sPath) |
-- load the image from a file named sPath |
I:Byteswap() |
-- perform the operation |
I:Save() |
|