Transform an image into an assembly variable.
Just drag & drop your PNG file to Serve.exe (or manually run the .py script with the png location as an argument) and you'll get a file containing the declaration of an assembly compatible variable.
Customization can be added if you run the application. A small interface with features like: selecting input/output location, selecting a variable name.
Additionally, an 8-bit image will result in an .inc file containing a byte array (values from 0 to 255), while any other image will result in a .inc file containing a dword array, with the values being the color values of the pixels.
If you want an 8-bit image to be converted to a dword array, make sure to check the 'forceRGB' checkbox, or to use the third argument for the script with any non-falsy value.
An input directory can be selected to convert all the images inside it. The directory input has priority over the file input in the case both are selected. Additionally, the directory should only contain image files.
The generated output is an .inc file which can be imported in any Assembly x86 code. For example, this could be used by a library with the capability to draw a canvas to show an image:
Because of the limitation of the statement definition length, the generated .inc
file will split the variable in multiple ones in case an image exceeds the horizontal length of 48px.
β¨ More features on the way β¨
This is a list of wonderful projects that used this library. If you want yours added, let me know!