![]() In order to force convert to change an image this way, you need to add a ! to the end of the geometry specification (and, since ! is a special character to many shells, you need to escape it as \!): $ convert -resize 200x50\! foo.png bar.pngīar. So, when changing the proportions, the command above fails. In order to force convert to change an image this way, you need to add a to the end of the geometry specification (and, since is a special character to many shells, you need to escape it as \ ): convert -resize 200x50\ foo.png bar.png file bar.png bar.png: PNG image data, 200 x 50, 8-bit colormap, non-interlaced. But what if you want to change them? $ convert -resize 200x50 foo.png bar.png However, if you want to change to an arbitrary size, they will fail: $ file foo.pngįoo.png: PNG image data, 1000 x 500, 8-bit/color RGB, non-interlacedīar.png: PNG image data, 100 x 50, 8-bit colormap, non-interlacedĪs you can see above, the simple convert works fine when not changing the image's proportions. converting all jpg to png in a folder -cl open (.jpg) saveas (.png) turning all jpg files to brighter ones with 3030px size -cl open (. The shortest code to scale down an image: imagepdb.gimpfileload ('/tmp/bigger.png','/tmp/bigger.png') image.scale (int (image.width.5),int (image.height.5)) pdb.gimpfilesave (image, image.activelayer, '/tmp/smaller.png','/tmp/smaller.png') So, you can still put everything in a one liner. The answers you have gotten so far will work in this particular case because your source and target images have the same aspect ratio.
0 Comments
Leave a Reply. |