I need to enlarge already big jpegs, they are used on printing so they need to be really big 300PPI files. The resulting image will be too big to be fully hold in memory. What i thought was something like breaking the original image into small strips, enlarge each one of them separatedly and go writing it in the output file(another jpeg), never keeping the final image fully on menoru. I've read about lossless operations on jpegs it seems the way to go(create a file with the strip and copy the mcus, huffman tables and quantizatuon tables to the final file), also read something about abbreviated streams on java. What is a good way to do this?
Asked
Active
Viewed 30 times
-1
-
Interesting note: 2D image scaling is exactly why I gave up on 2D game programming and moved onto 3D. My efforts of scaling images invariably led to the same conclusion: It can't be done appropriately. – Krythic Apr 17 '16 at 02:53
-
Why do you think you would be able to scale the images better than a good printer? You will basically just increase the file size, without increasing the quality, as all the data you are adding is just interpolated (or extrapolated) from the original image. – Harald K Apr 18 '16 at 10:58
1 Answers
1
Your best bet is to leave the JPEGs alone and have the printing software scale the output to the device.
If you really want to double the size,you could use subsampling. Just double the Y component in each direction and change the sampling for Cb and Cr while leaving the data alone.
You could also do as you say, and recompress in strips of MCUs.

Harald K
- 26,314
- 7
- 65
- 111

user3344003
- 20,574
- 3
- 26
- 62
-
How could i recompress the strips without having the whole image on memory? – leonardo albuquerque Apr 17 '16 at 13:38
-
You'd have to write something that would read in MCU rows one at a time, expand them, and compress them. I still think your best best is to let the device scale the images. You are not going to be able to do smoothing this way. – user3344003 Apr 17 '16 at 15:08