All Projects → sparkfun → BMPtoArray

sparkfun / BMPtoArray

Licence: other
Python script to convert a bitmap to an Arduino prog_mem array for outputting grayscale images to OLEDs.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to BMPtoArray

Lipo Charger Basic-microUSB
Lipo Charger Basic product 10217
Stars: ✭ 14 (-44%)
Mutual labels:  sparkfun
Doramon
个人工具汇总:一致性哈希工具,Bitmap工具,布隆过滤器参数生成器,Yaml和properties互转工具,一键式生成整个前后端工具,单机高性能幂等工具,zookeeper客户端工具,分布式全局id生成器,时间转换工具,Http封装工具
Stars: ✭ 53 (+112%)
Mutual labels:  bitmap
Spectrum Shield
Spectrum Shield for Arduino, available from SparkFun Electronics.
Stars: ✭ 21 (-16%)
Mutual labels:  sparkfun
arduino-midi-footswitch
USB MIDI Pedal built with Arduino
Stars: ✭ 24 (-4%)
Mutual labels:  sparkfun
CQULogo
重庆大学视觉标识素材包 --- Visual Identification Bundle of Chongqing University
Stars: ✭ 55 (+120%)
Mutual labels:  bitmap
SunnyBuddy
MPPT single-cell LiPo battery charger based on the LT3562
Stars: ✭ 29 (+16%)
Mutual labels:  sparkfun
Qwiic Spectral Sensor AS726X
Qwiic breakout for the AS7261/AS7262/AS7263 spectral sensors from AMS.
Stars: ✭ 20 (-20%)
Mutual labels:  sparkfun
ESP8266 Thing
A breakout and development board for the ESP8266 WiFi SoC.
Stars: ✭ 41 (+64%)
Mutual labels:  sparkfun
SparkFun MMA8452Q Arduino Library
SparkFun Triple Axis Accelerometer Breakout - MMA8452Q Arduino Library
Stars: ✭ 16 (-36%)
Mutual labels:  sparkfun
SparkFun AutoDriver Arduino Library
Arduino library support for the SparkFun AutoDriver board based on the ST Micro L6470 stepper driver.
Stars: ✭ 14 (-44%)
Mutual labels:  sparkfun
ESP32 Thing Plus
ESP32 Thing-compatible board using the WROOM module and a QWIIC connector.
Stars: ✭ 18 (-28%)
Mutual labels:  sparkfun
RF Links
These wireless transmitters and receivers easily fit into a breadboard and work well with microcontrollers to create a very simple wireless data link.
Stars: ✭ 53 (+112%)
Mutual labels:  sparkfun
scd30
arduino esp8266 ESP8266 SCD30 SCD-30 ESP32
Stars: ✭ 38 (+52%)
Mutual labels:  sparkfun
SparkFun ATECCX08a Arduino Library
An Arduino library to use with the Microchip ATECCX08a Cryptographic Co-processors.
Stars: ✭ 26 (+4%)
Mutual labels:  sparkfun
Big Easy Driver
The Big Easy Driver available from SparkFun Electronics
Stars: ✭ 21 (-16%)
Mutual labels:  sparkfun
Github Tutorial
A very basic and flawed piece of code to show how Github GUI works.
Stars: ✭ 72 (+188%)
Mutual labels:  sparkfun
OpenLCD
An open source serial LCD (HD44780) controller based on the ATmega328.
Stars: ✭ 28 (+12%)
Mutual labels:  sparkfun
FastBitmap
A fast C# Bitmap wrapping layer
Stars: ✭ 86 (+244%)
Mutual labels:  bitmap
cocoa-close-pixelate
Cocoa port of https://github.com/desandro/close-pixelate
Stars: ✭ 47 (+88%)
Mutual labels:  bitmap
AsciiMap
Creates ASCII Art from Bitmaps
Stars: ✭ 21 (-16%)
Mutual labels:  bitmap

SparkFun Bitmap to Progmem Array

SparkFun Micro OLED Breakout

SparkFun Flexible Grayscale Display (SPX-14543)

This script takes in a bitmap and converts the bitmap into 4-bit grayscale. An array of bytes is generated that can be copy/pasted into a header file.

This is very useful if you have a bitmap that you'd like to output onto a grayscale display (like the SparkFun flexible OLED). I attempted to use the bitmap2lcd program but found it very hard to use and over blown (and costs money) to generate an image array.

Three bitmaps are provided as an example. Requires python v2.7+.

To use your own image:

  • Convert your JPEG or whatever format to BMP
  • Down convert the BMP to Black and White only. This should retain the grayscale components but remove any color information. We use paint.net and recommend it for use with this repo.
  • Run the python script against your bitmap
  • An output.txt file will be generated. Copy and paste the contents of this file to a image.h file
  • Send this array to the display of your choice. See the example below about how to implement the header file.

Usage:

python bmp2array.py macaque.bmp

Example output:

static const unsigned char myGraphic[2560] PROGMEM = {
0xf, 0xf0, 0x44, 0x44, 0x44, 0x44, 
0x84, 0xa9, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 
0xaa, 0x6a, 0x44, 0x44, 0x54, 0xa9, 0xaa, 0xaa, 
0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x6a, 0x25, 0x22, 

You can find an example of how to implement the header file here.

This is pretty much my first hack at python so I greatly welcome improvements with a pull request.

License Information

This product is open source!

The code is released under the GPL v3 license. See the included LICENSE.md for more information.

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].