Skip to content

Image Collections

Paul Andrews edited this page Feb 21, 2024 · 10 revisions

Clock Faces

Clock faces have to be in .tar.gz format - if you're on a Mac or Linux you can use a command line shell to create these, otherwise there are online tools such as this one.

All of the ones in the image above are in the data/ips/faces directory of this project, so if you delete them from the clock you can just upload them again from there.

Each file has to contain 10 images 0.bmp through 9.bmp. It can also contain four additional files space.bmp, colon.bmp, am.bmp and pm.bmp (these are used in the four-digit display if they are there).

The BMP files can be 1, 2, 4, 8, 16 or 24 bit BMP files and should be smaller than or equal to 135x240 pixels. Small images are drawn centered in the display. I have included a python script in the tools directory that can convert most graphic files to one of the formats the clock can use.

The name that appears in the GUI is just the filename with the .tar.gz extension removed.

Weather Icons

Weather icon sets have to be in .tar.gz format - if you're on a Mac or Linux you can use a command line shell to create these, otherwise there are online tools such as this one. There are two provided in the data/ip/weather directory.

The file should contain 18 BMP files, 9 for daytime conditions and 9 for nighttime conditions. These are named after the icons used by openweathermap.org. The BMP files can be 1, 4, 8, 16 or 24 bit BMP files and should be smaller than or equal to 128x128 pixels.

Image Conversion Tool

There is a python script in the tools directory called batch_convert_images.py. Python was an obvious choice to write this in as you will already have it installed if you have built the firmware, and it comes with a good set of libraries for writing tools like this. You may need to install some additional python libraries:

pip install pillow
pip install cairosvg

Run it with the -? argument to see this help:

usage: batch_convert_images.py [-?] [-b BACKGROUND_COLOR] [-o OUTPUT] [-p {1,2,4,8,16,24,32}] [-d] [--brightness BRIGHTNESS] [--add ADD] [--contrast CONTRAST] [-c COLS] [-r ROWS] [-w WIDTH]
                               [-h HEIGHT] [-t] [-f] [-i] [--invert] [-s] [--scale_icon SCALE_ICON]
                               file [file ...]

Batch convert image files, including output to 16 bit RGB565 format (default!)

positional arguments:
  file

options:
  -?, --help
  -b BACKGROUND_COLOR, --background BACKGROUND_COLOR
                        background color used when downsampling images with an alpha channel, e.g WHITE or BLACK - defaults to BLACK
  -o OUTPUT, --output OUTPUT
                        output file type - defaults to bmp
  -p {1,2,4,8,16,24,32}, --bpp {1,2,4,8,16,24,32}
                        bits per pixel - defaults to 16
  -d, --dither          use dithering when downsampling
  --brightness BRIGHTNESS
                        Modify the brightness(!) >1.0 increases brightness, 1.0 = original brightness, 0.0 = black
  --add ADD             Add a value to each pixel, use a negative value to subtract from each pixel
  --contrast CONTRAST   Modify the contrast >1.0 increases contrast, 1.0 = original contrasy, 0.0 = grey
  -c COLS, --cols COLS  number of columns to split input into - defaults to 1
  -r ROWS, --rows ROWS  number of rows to split input into - defaults to 1
  -w WIDTH, --width WIDTH
                        width of input binary file in pixels (RGB565 without header)
  -h HEIGHT, --height HEIGHT
                        height of input binary file (RGB565 without header)
  -t, --trim            trim input image to content - applied after scaling if used
  -f, --fuzzy           use a fuzzy trim when trimming, used in conjuction with -t
  -i, --info            only show image info
  --invert              Invert colors
  -s, --scale           scale the input/tile to 135x240 maintaining aspect ratio
  --scale_icon SCALE_ICON
                        scale the input/tile to valxval maintaining aspect ratio. Default is to not scale

This will actually output any image format supported by the pillow library, but the aim is to produce .bmp files. Note that if it is processing a binary file (ends in .bin) it doesn't down-sample, scale, trim etc. The resulting .bmp file can be processed after it has been created

When you run it, it will write the output images to the current directory and will happily overwrite what is already there. This is fine for cases like converting .png files to .bmp files because the source file name is guaranteed to be different. If it is a problem either save the originals or just have them in a different directory.

As a general idea, the smaller the bits per pixel, the better as this produces smaller files. I have found that 8 bits is generally fine, especially if you combine it with dithering. To get some idea of what you are dealing with, run the script with -i flag which will tell you the size and number of colors in each image. Anyhow, you can just run the script multiple times with different arguments until you are happy with the results.

Images on the Web

  • The project has additional clock faces in more_faces.
  • Look at the displayArray project on github for some beautiful clock faces that include additional useful images like colons and am/pm. The project itself looks interesting too. I find this command works well to get the correct gamut for the EleksTube clock: batch_convert_images.py -p 8 --contrast 2.65 --brightness 0.5 -t *.png
  • EleksTubeHAX is the project that started all this. It has all of the original faces provided by Eleksmaker.
  • The original Eleksmaker upload tool has all those image files too. Remember that my batch conversion tool can dice and slice a single image in to multiple BMPs.
  • There are additional clock faces on the Elekstube blog that were intended for use on V2 of their hardware.
  • Aircookie Nixie Themes
Clone this wiki locally