Add a solid border without changing the overall size - 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: Add a solid border without changing the overall size (/Thread-Add-a-solid-border-without-changing-the-overall-size) |
Add a solid border without changing the overall size - Summoner99 - 05-09-2020 I'm fairly new to Gimp, so this might be a straightforward answer. I have a collection of images that are a solid color with transparent backgrounds. https://imgur.com/a/mw6jj6x This is a crude example. The left arrow is the type of image I have where Green is the solid color and White is transparent. My goal is to add borders like the red in the example. The middle adds a single layer of pixels outside of the original, overwriting some transparency. The right replaces the outermost layer of pixels with a new color without replacing any transparent pixels. Clearly the optimal solution would work for any number of pixels. The images are not simple polygons so I can't just use a specialized rectangle/circle/etc drawing tool. I created the example by using the pencil tool and manually changing pixels to red. This is not feasible for larger images. Also avoiding some sort of smoothing would be nice. I want the border to be a solid color. Any solutions that involve smoothing are still acceptable. Thanks for any and all advice! RE: Add a solid border without changing the overall size - Ofnuts - 05-09-2020 Layer>Transparency>Alpha to selection, and do something with the outline of that selection:
The "Stroke path" method (in the three modes: over, inside, outside) is used by my ofn-outline-layer script that you will find here. RE: Add a solid border without changing the overall size - rich2005 - 05-09-2020 Using standard Gimp tools. border around: Add a layer under the icon Color select the icon Grow the selection x pixels Fill layer under icon Turn selection off merge layers border inside: Toggle alpha lock on Color select icon Shrink the selection x pixels Invert the selection Fill the selection Turn selection off Toggle alpha lock off Example: 2 minutes https://youtu.be/YbS9dFhGOoQ |