It is currently Tue Sep 29, 2026 1:32 pm


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 1:51 pm  (#1) 
Offline
New Member

Joined: Oct 04, 2014
Posts: 2
GIMP Version: 2.8.10
Operating System: Windows
GIMP Experience: Basic Level

I'm an icon themer and I go through hundreds of images. All of them are 192x192, and I'd like to make it so that the canvas size remains at 192x192, but the image is scaled down to say 144x144 so that there is a transparent border between the image and the boundary. I need to keep the transparent space as I add shadows etc. I've tried doing this with BIMP, but it'll never keep the empty space and will always resize the canvas. Is there any way to do this automatically rather than manually by eye?

If not, do you guys have any tips on scaling? Currently, I haven't found a way to resize images so that they transform based on the center point, so I need to resize then move (which is obviously quite inaccurate)

Thanks!





Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 1:54 pm  (#2) 
Offline
GimpChat Member
User avatar

Joined: Apr 07, 2010
Posts: 14182
You could use the resize tool to scale your image but not the layer :scale

_________________
Image


Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 2:06 pm  (#3) 
Offline
GimpChat Member
User avatar

Joined: Nov 16, 2011
Posts: 5127
Location: Metro Vancouver, BC
The proper tool to use for a batch job like this is either, ImageMagick or GraphicsMagick command line.
Check Fred's ImageMagick Scripts which can be easily adapted for use with GraphicsMagick as well.

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)


Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 2:34 pm  (#4) 
Offline
GimpChat Member
User avatar

Joined: Oct 06, 2013
Posts: 143
Not a perfect solution, perhaps, but a possibility.

The fx-foundry plugin - http://gimpfx-foundry.sourceforge.net/ - has a multi-layer tools section with scale/crop, and it will center the resized layers. Getting all layers back to boundary size with transparent borders is a bit odd -- assuming they all have an alpha channel, you use the Crop function, with "To image boundaries?" set to Yes. I would suggest installing this plug-in, and playing around with it with. See how many layers you can handle at a time without taking Windows down, lol.

_________________
Image


Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 2:48 pm  (#5) 
Offline
GimpChat Member

Joined: Mar 04, 2011
Posts: 2615
I am with Odinbc and Imagemagick.

mogrify -format png -channel rgba -alpha on -resize 144x144 -matte -bordercolor none -border 24 *.png


Run that in a folder with all the images.

Note mogrify is a dangerous command. It will overwrite the files so work with copies.

edit: a bit of a struggle but..
If you want a graphical interface then it is possible using XnViewMP batch convert
Three actions required.
resize down to 144x144
canvas back up to 192x192
a b&w mask to set the border to alpha.


Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 9:47 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
The following script adds a command, "Filters->Misc->Fvful", that performs what you ask.

http://chiselapp.com/user/saulgoode/rep ... dd5986a10d

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: Is this resizing script possible?
PostPosted: Sat Oct 04, 2014 11:05 pm  (#7) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Asdfasdfvful Saulgoode's script is a perfect solution for the problem, just run it in Bimp

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group