Gimp-Forum.net
Adding alpha to make a rectanglular image, square - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Adding alpha to make a rectanglular image, square (/Thread-Adding-alpha-to-make-a-rectanglular-image-square)



Adding alpha to make a rectanglular image, square - Summoner99 - 01-22-2020

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


RE: Adding alpha to make a rectanglular image, square - denzjos - 01-22-2020

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]


RE: Adding alpha to make a rectanglular image, square - Blighty - 01-22-2020

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"


RE: Adding alpha to make a rectanglular image, square - Ofnuts - 01-22-2020

You can also "uncrop" the image (use the Crop tool and tick the "Allow growing" option)