Loading Remote Images w WiFly Shield and Printing

I’m trying to print Twitter profile images w the Thermal Printer from Sparkfun…

I was hoping someone could point me in the right direction on how to load images with the WiFly shield from a remote a web server. Once the images are loaded on the Arduino, I’m hoping printing will be trivial.

I’m already able to connect to my network and parse Twitter API for image urls. I’m just not sure where to go from here.

I’m using the latest library here:

https://github.com/sparkfun/WiFly-Shield

Thanks,

SMJOHN

insultcomicdog:
I’m hoping printing will be trivial.

Nothing about this is going to be trival, sorry. Heck it might not even be possible. While the printer has some graphics capability it doesn’t do grayscale. There are games you can play to simulate it, but you might not have enough horizontal resolution to accommodate it.

Now let’s talk about the Twitter profile images which are JPEG format. The JPEG format offers great image compressibility while maintaining image quality, but the trade-off is complicated encoding and decoding algorithms. The Arduino isn’t going to be able to decode them by itself.

In addition to the downloaded jpeg you’ll need enough space for the grayscale image at least until the conversion is complete. I pulled up a random Twitter profile. The bigger 128x128 image weighed in at 7.5k as a color jpeg. When converted to a grayscale raster that bulks out to 16,384 bytes. You’ll need 24kb of storage which the Arduino simply doesn’t have (though the Mega might be able to fit both). The smaller 48x48 images are 2.5k and 2304 bytes respectively. Call it 5kb. Maybe you can squeeze those into the Arduino’s flash memory but don’t trust me, I’m not done with my coffee :lol: