Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

append multiple jpg images to form multipage jpg Image  RSS feed

 
Ayub ali khan
Ranch Hand
Posts: 395
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 4 jpeg images, I am able to append each image below the other, however the size is reduced of the entire combined image. Could any one suggest a solution as to how I can create the a multipage jpg image after appending all the images ? I can only use jpg format for business reasons and not a multipage tiff image.





Thanks
Ayub
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean with "the size is reduced"? The file size? That's not that strange, considering you are reducing the JPEG format overhead. Instead of 4 images containing the initial bytes that determine that the file is a JPEG file, now only one image has those bytes.

Also, JPEG is a lossy format so you may have lost a bit of quality. You can specify the quality by switching from ImageIO.write to using an ImageWriter and using its write method.
 
Ayub ali khan
Ranch Hand
Posts: 395
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

I mean that the appended images are treated as a single image instead of treating each image as an individual page. I have to open the image and then zoom to see the images in their original size. When I print this everything is printed on a single page.

How to append images using their original size and be able to print those images on different pages ? I think JPG does not support multi images as multipage ?

Thanks
Ayub




 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ayub ali khan wrote:I think JPG does not support multi images as multipage ?

It most certainly does not. As far as I know the only image type that really has a notion of pages is TIFF, but you already said you can't use that. With all others the only thing you can do is guess how many pixels fit onto a page, then leave gaps between images. I doubt that will work well though.

Perhaps PDF is an option for you. I'm sure that with iText you can create a new PDF file with one image per page.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!