Here's a utility to convert standard Image formats to the X16 BMX image file format.
Requires imagemagick to be installed. There is a link to ImageMagick for Windows at the end of this post.
23 MAY 2024
Fixed Padding errors with Image files where width not evenly divisible by 4.
Now also recognizes file names with spaces properly.
Ok 3 updates in 12 hours and nobody downloaded it..lol.
I'm now considering this a fairly MAJOR UPDATE.
In addition to the bug fixes there are now 2 new features
User chooses how many colors to use in the conversion.
Valid values are 17 to 256.
(If I use 16 imagemagick steps in and makes a 4bpp image which I can't use)
If Num Colors < 250 all these colors are shifted to the End of the Palette.
Pixel values from Indx 0 to 1 less than image pixel start
will use VERA default values.
Default value is 240 which leaves the Text Palette as VERA Default.
There is now an option to also Output a VERA BIN and PAL file as well as the BMX
so this now replaces my img2bvload program and gives it the same palette shifting feature.
Recommend you use this from the command line so you know what resolution is being
output. BIN files < 320 width require some manipulation to be used effectively,
Starting with you need to know the resolution. It is output on the console when using img2bmx
from the command line. (It will also be stored in the BMX Header if you miss the output).
HERES THE UPDATED CONVERTOR 05-23-2024
04-18-2024 MAJOR UPDATE
img2bmx now makes sure that the BMX image will not use the VERA Text Palette Indices. This limits them to 240 colors but makes it much easier to use them in a program. You can use the Text Colors without scrambling the colors on the Image. You can also fade out the Image colors to black without fading out the Text on Screen. I've combined the source and the Windows and Linux versions in one archive this time. The MAC build is not yet updated. I'll need the aid of someone to build it for me that has a MAC.
(current MACOS build IS NOT up to date, it does not have the feature of reserving the text colors yet
or the Image.Width fix) and still has the bug with filenames with spaces
MACOS BUILD (courtesy of AndreasEK)
TEXT FROM THE README FILE.
The BMX Convertor is written and compiled in QB64 Phoenix Edition. This has
several unique features from the Standard QB64 release and this program makes
use of some of them.
QB64 Phoenix Edition
--------------------
https://qb64phoenix.com
1. Preserves Aspect Ratio of converted files
2. Resizes only if necessary (files that fit in 320 x 240 are not resized)
3. Operates as a Hybrid command line/GUI app. If a command line
argument is given then that file is converted. Multiple files
can be passed on the command line. (including *.jpg *.png, etc.)
4. If no command line argument then you get a file dialog to select the
file(s) to convert.
5. Works on GIF, BMP, PNG, JPG, AIFF, TIFF and WEBP (Probably others)
If ImageMagick supports the format my convertor will probably work
on it. Only the listed extensions will be in the Dialog but you
can switch to all files if you want to try a different format.
6. WINDOWS EXECUTABLE IS NOW ONLINE.
The DEFINES I put in the source worked perfectly.
7. MACOS Build added courtesy of AndreasEK.
When I wrote my previous BVLOAD convertor I had problems under Windows with certain
ImageMagick versions that used 16 bits per color channel. I did include a link on there
before but the ImageMagick people have broken my link twice now.
The ImageMagick License allows redistribution with attribution. This belongs
to ImageMagick Studio. LLC.
License link here: https://imagemagick.org/script/license.php
I'm including here the 8 bit per color channel version for Windows that works correctly with
both of my convertors.
IMAGE(.jpg, .png, etc) to BMX file convertor.
- ahenry3068
- Posts: 1134
- Joined: Tue Apr 04, 2023 9:57 pm
IMAGE(.jpg, .png, etc) to BMX file convertor.
Last edited by ahenry3068 on Sun May 26, 2024 10:21 pm, edited 19 times in total.
Re: IMAGE to BMX file convertor.
Some feedback:
- some may not want to go through a "3rd party installer"; maybe you can have an INI where you just point to the imageMagick executable?
- I didn't have ImageMagick installed; your converter "still works" in that it makes ~500 byte "blank files". Maybe it can detect no imageMagick and give a warning?
- The converted results are written to the same folder as the opened file, not the folder I'm running from. Maybe this could be another setting in the INI file. For me, I'd prefer the output to go where I am running the converter from, not output to where I've selected the images at. (but that's just me and my workflow) [ I used the no-command line GUI; I suspect actual command line will use CWD for output ]
- think your Windows package should be called img2bmx_win64 (instead of win2bmx)
- more of a forum thing: how about adding BMX as a supported/authorized attachment file extension?
Once setup though - the converter does work. I only did some PNGs and JPEGs. I "batch converted" a few images, then used the prog8 desertfish imageviewer to view them. Good stuff!
- some may not want to go through a "3rd party installer"; maybe you can have an INI where you just point to the imageMagick executable?
- I didn't have ImageMagick installed; your converter "still works" in that it makes ~500 byte "blank files". Maybe it can detect no imageMagick and give a warning?
- The converted results are written to the same folder as the opened file, not the folder I'm running from. Maybe this could be another setting in the INI file. For me, I'd prefer the output to go where I am running the converter from, not output to where I've selected the images at. (but that's just me and my workflow) [ I used the no-command line GUI; I suspect actual command line will use CWD for output ]
- think your Windows package should be called img2bmx_win64 (instead of win2bmx)
- more of a forum thing: how about adding BMX as a supported/authorized attachment file extension?
Once setup though - the converter does work. I only did some PNGs and JPEGs. I "batch converted" a few images, then used the prog8 desertfish imageviewer to view them. Good stuff!
- ahenry3068
- Posts: 1134
- Joined: Tue Apr 04, 2023 9:57 pm
Re: IMAGE to BMX file convertor.
I'm afraid the setup is necessary. ImageMagick is a bit to sophisticated to "just" point at the executable.
Re: The archive name. Old fashioned dyslexia. I didn't see a need to change it immediately. When ever I do an update I'll change it.
Re: I think the target directory is reasonable when using the GUI which can go anywhere on the computer or network. (Converting on a network drive slows things a bit) . If you use the command line cwd is probably going to be where the image files are anyway. Btw: wildcards work on the command line in Linux and Windows. i.e. img2bmx *.jpg will convert all *.jpg files in the current directory to BMX. One difference between Windows and Linux version. In Linux this is case sensitive, in Windows it is not. (which is really the correct and expected behaviour in the respective OS's).
The first item I'm afraid is a bug. I'll try to fix that and the one with spaces in the path name to the file in the next few days.
Re: The archive name. Old fashioned dyslexia. I didn't see a need to change it immediately. When ever I do an update I'll change it.
Re: I think the target directory is reasonable when using the GUI which can go anywhere on the computer or network. (Converting on a network drive slows things a bit) . If you use the command line cwd is probably going to be where the image files are anyway. Btw: wildcards work on the command line in Linux and Windows. i.e. img2bmx *.jpg will convert all *.jpg files in the current directory to BMX. One difference between Windows and Linux version. In Linux this is case sensitive, in Windows it is not. (which is really the correct and expected behaviour in the respective OS's).
The first item I'm afraid is a bug. I'll try to fix that and the one with spaces in the path name to the file in the next few days.
- ahenry3068
- Posts: 1134
- Joined: Tue Apr 04, 2023 9:57 pm
UPDATE: IMAGE to BMX file convertor.
Updated this to preserve VERA Text Colors in the BMX file. BMX files will now be 240 colors and the VERA default text colors will be included in the BMX Palette for Indices 0-15.
- ahenry3068
- Posts: 1134
- Joined: Tue Apr 04, 2023 9:57 pm
UPDATE: IMAGE to BMX file convertor.
This has changed from a BUG fix update to a MAJOR UPDATE with
some new features.
Threw in my showbmx BMX Viewer in the archive as well.
Set main post:
viewtopic.php?p=30702#p30702
some new features.
Threw in my showbmx BMX Viewer in the archive as well.
Set main post:
viewtopic.php?p=30702#p30702