4

I want to generate one single JPEG image file for PSD formats using any software.

I tried ImageMagick but it's converting every layer into different images.

I also tried exiftool. It got converted to one single image but quality is very bad.

This is my code in ImageMagick:

convert filename.psd -thumbnail 340x340 testing.jpg

This is exiftool :

exiftool -Photoshop:PhotoshopThumbnail -b -resize filename.psd >z1.jpg
Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25
Shilpi Agrawal
  • 153
  • 1
  • 15

3 Answers3

4

I got this answer:

convert filename.psd -flatten -quality 100 z.jpg

We can change the quality parameter.

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
Shilpi Agrawal
  • 153
  • 1
  • 15
2

To generate thumbnails, you should run:

 convert filename.psd -flatten -thumbnail 340x340 filename-thumb.jpg

or

 convert filename.psd -flatten -thumbnail 340x    filename-thumb.png

or

 convert filename.psd -flatten -thumbnail    x340 filename-thumb.gif

or similar. (Find out yourself what the different sizes will be when varying between 340x340, 340x and x340.)

Note, the key parameter to get rid of the unwanted '1 image per layer' output: you have to insert -flatten into the command.

Kurt Pfeifle
  • 86,724
  • 23
  • 248
  • 345
1

Vipsthumbnail in libvips can do this:

Vipsthumbnail filename.psd --size 300x

See the libvips docs

and if it's ok for you just to use the psd embedded thumbnail (as small as 160x160 in px), it's super fast to extract thumbnail image with psd-tools:

from psd_tools import PSDImage   
PSDImage.open('filename.psd').thumbnail().save("thumb.png")
Shayan Shafiq
  • 1,447
  • 5
  • 18
  • 25
Jindi Li
  • 55
  • 2
  • 9