Gimp-Forum.net

Full Version: Adding alpha to make a rectanglular image, square
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm fairly new to gimp, so this might be a really obvious question, and I definitely might have missed this answer during my internet search.

I have a rectangular black and white image that is taller than it is wide (but a solution that applies to one that is wider than it is tall would be great as well). I'd like to add transparent pixels on either side so that when I export it as a png, its size is square, but the original part of the image is still centered nicely. 

The best idea I have is to create a square image of only transparent pixels then select the entirety of the original image and paste it onto this new image and somehow keep it centered.

Again, I am a beginner so I'm pretty positive there is a better solution.

Thanks in advance.

Edit:
Turns out what I thought of was a fairly easy solution
On the top layer :
- add alpha channel (right mouse button) 
- make a square selection
- inverse the selection (selection / invert)
- Colours / Colour to Alpha

[attachment=3840]
Use Image > Canvas Size

1. Set value of Height (or Width) so that W and H have the same value.
2. Press "Center"
3. Press "Resize"
You can also "uncrop" the image (use the Crop tool and tick the "Allow growing" option)