Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Convert PNG or BMP logo image to C array Arduino

Status
Not open for further replies.

imranahmed

Advanced Member level 3
Advanced Member level 3
Joined
Dec 4, 2011
Messages
817
Helped
3
Reputation
6
Reaction score
3
Trophy points
1,298
Location
Karachi,Pakistan
Activity points
6,493
Please let me know how to convert PNG or BMP logo image to C array. I have thermal printer QR-701, TTL, 9600baud, Page Width 58mm.
I want to print logo and I am using Arduino Mega2560.
Logo is attached and please let me know how to set image size according to my thermal printer.
 

Attachments

  • BSL.png
    BSL.png
    8.7 KB · Views: 207

Hi,

Baud rate and paper width means nothing.
Pixel count in X and Y is what matters.
Read the printer datasheet.

Klaus
 
Have you tried Google? My search came up with quite a few options, both on-line tools and source code.
Susan
 
Hi,

Any picture data can be put into a array of bytes.

Often those printer manufacturers provide a (online) tool.
Do a search on their internet site.

Then it depends on the expected data format. Usually an uncompressed black/white bitmap is simple to transform to the printer bitmap.

Klaus
 
Have you tried Google? My search came up with quite a few options, both on-line tools and source code.
Susan
Yes I tried google. Only few options are available but it is working I tried it on my printer.
--- Updated ---

Hi,

Any picture data can be put into a array of bytes.

Often those printer manufacturers provide a (online) tool.
Do a search on their internet site.

Then it depends on the expected data format. Usually an uncompressed black/white bitmap is simple to transform to the printer bitmap.

Klaus
Ok.
 

Arduino is not power enough to decode PNG images, as the decoding algorithm in line reconstruction can easily cause overflow in the RAM.
You can search for bmp file format, it's not compressed so you read raw binary files after 54 bytes of header.
 

I'm not sure that the OP was suggesting USING an Arduino to do the conversion. I take it that they want the result of the conversion to be used by the Arduino to send to the printer.
Susan
 

I'm not sure that the OP was suggesting USING an Arduino to do the conversion. I take it that they want the result of the conversion to be used by the Arduino to send to the printer.
Susan
In that scenario windows Paint can convert PNG into bmp files. Reading bmp into array in C is easy task.
 

Any graphics editor convert PNG to BMP files. And as written above "Reading bmp into array in C is easy task."
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top