Scale2pics - batch image scaler

Paint programs, vector editors, 3d modelers, animation editors, etc.
Post Reply
Message
Author
User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

Scale2pics - batch image scaler

#1 Post by MU »

http://dotpups.de/dotpups/Graphics/Scale2pics.pet (13 kb)
Mirror: http://puppyfiles.ca/dotpupsde/dotpups/ ... e2pics.pet

Requires Gtk2, was compiled in Puppy 3.

If the binaries do not work in your Puppy, you can compile them like this:

cd /usr/local/Scale2pics
./install

usage: (scale2pics)

This converts a whole folder.

scale2pics /usr/share/backgrounds /root/testpics/ 30 20 85 jpg
(the targetfolder may not exist yet)

This will do:
- create a folder /root/testpics/
- create in this folder scaled jpg-files with a maximum size of 30x20 pixel, with 85% quality from all pictures in /usr/share/backgrounds.


usage: (scale2pic)

This converts a single file.

scale2pic /usr/share/backgrounds/default.jpg /root/testpics/output.png 30 20 60
(the targetfolder here must exist already)

Supported input formats: did not try, at least these work: xpm, png, bmp, jpg

Supported output-formats: png, bmp, jpg, ico (NOT xpm!)


----------------------------------------
Both are scripts.
They use 4 binaries. To see how those work, you can look at the script:
/usr/local/Scale2pics/example

Note: the scripts keep the aspect-ratio.
if you have a source of 320x200, and give as targetsize 32x1000, then you will get 32x20, as the sizes define the maximum values, if the aspectratio allows them.
This is very fine, if you want to batch-convert pictures for websites, where pictures should never be higher or wider than 50px for thumbnails.

Mark
[url=http://murga-linux.com/puppy/viewtopic.php?p=173456#173456]my recommended links[/url]

User avatar
kevin-isca
Posts: 13
Joined: Sun 20 Apr 2008, 09:21
Location: Exeter, Devon
Contact:

#2 Post by kevin-isca »

Many thanks MU
This is simple (for me to use :D ) and works!!

stu90

#3 Post by stu90 »

Sorry for bumping old thread but this is a great little .pet

wasted so much time resizing 1 file at a time in gimp.

thanks.

emil
Posts: 633
Joined: Tue 10 Nov 2009, 08:36
Location: Austria
Contact:

works in 5.1 quickset edition

#4 Post by emil »

works still in 5.1. quickset edition without hassle.
great! :D

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

picscale

#5 Post by vovchik »

Dear Puppians,

I did this a while back and seems to work. It is also pretty small and can be used in scripts for rescaling various file types using only gdk calls (like Mark's). Please have a look http://www.murga-linux.com/puppy/viewto ... h&id=34335. I included a binary.... The reason I did this was because, as I recall, Marks version did not handle the alpha channel (png transparency) properly.

With kind regards,
vovchik

User avatar
GustavoYz
Posts: 883
Joined: Wed 07 Jul 2010, 05:11
Location: .ar

#6 Post by GustavoYz »

vovchik wrote:...handle the alpha channel (png transparency) properly...
Thanks!
:D

User avatar
Argolance
Posts: 3767
Joined: Sun 06 Jan 2008, 22:57
Location: PORT-BRILLET (Mayenne - France)
Contact:

#7 Post by Argolance »

Thank you! There are so many "forgotten" things in this Forum...

Pelo

A l'essai

#8 Post by Pelo »

# scale2pics
usage: scale2pics sourcefolder targetfolder width height quality(1-100) targetpicture-format(jpg or png or bmp or ico)
# scale2pics /usr/share/fotoxx /root/testpics/ 30 30 85 png

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#9 Post by rcrsn51 »

This was going to be my next suggestion! Did it work with your batch of PNGs?

Pelo

Feel my need (PNG icons to resize)

#10 Post by Pelo »

nice ! I aimed to change icons 48 to 24. Scale2pics does it.
I just have to notice the magic formula for terminal.
Attachments
Scale2pics.jpg
(50.97 KiB) Downloaded 400 times

Post Reply