i've found online a lot of sketch to take a snapshot and save it to a SD card, other which read when a button is pressed and another one to print a bitmap image... but nothing that combines all "out of the box"...
the first problem, before linking all the sketch into a "big- sketch", i need something that convert an image (JPEG) to a bitmap that i can print... is there something that do this thing?
Or there is a way to save the image captured by the TTL camera directly in Bitmap format?
That Adafruit example relies on the camera to do the JPG compression so that it doesn't have to spend several minutes per photo reading each byte of data. The example just copies data without understanding what it is copying.
You may have to do the JPG decompression inside the Arduino. Then you need a Mega or bigger. Not the most simple project.
i've found this on GitHub that is a JPEG decoder written to "rendering of Jpeg files stored both on SD card and in arrays within program memory (FLASH) onto a TFT display"
You can probably swap the metro 328 in your cart for the metro m0 and do your project. The M0 is essentially the same as an Arduino zero, which has boo-koo ram and runs 4 times faster than a 328.
So I'll go for a MEGA but from another company (order already placed) and I'll use the metro for other projects!
I don't need a super faster processor cause I'll take it low with resolution: the printer is limited to 384dots/line so my image will be low resolution and relatively small in size!
I was thinking to add an algorithm to have 1 shade of gray in addition to black and white:
I want to define if every pixel is white gray or black using the sum of the output on the RGB channel
Ex. A white pixel will be (255+255+255=765) a black one (0+0+0=0) so if I divide the range 765:0 in 3 section I'll obtain 765:510 white 510:255 gray 255:0 black
And this can be outputted by 4 dots:
White
0 0
0 0
Gray
1 0
0 1
Black
1 1
1 1
With this "pixel quadruplication" and the limitations of dot/line of the printer the best resolution will be something like NNN X 190 so I'll go for 320x240 image losing something like 1/3 of the image in height
Is there a way to decode a JPEG image in an array of pixel with RGB value?
The only "coding" language I know is MATLAB so I think in order of vector and matrix of value... Can this be done in Arduino?
Ok. So multiply it out. 320x240 times 3 bytes per pixel. Does that fit in the memory of the Mega with space left over for the jpg processor and anything else?
mhhh...
you are speaking a foreign language for me...
320x240x3=230400 bytes
from the tech specs the MEGA has "256 KB of which 8 KB used by bootloader" so this left me with 248000 bytes of free space, ergo 17kb for the sketch... will this be enough?