Post Reply 

How to place a white frame around an image?

Mar 5, 2012, 02:45
Post: #1
How to place a white frame around an image?
A book scan produced about 250 images (one per page) that have gray around the edges where the old paper was yellowed (almost brown). I want to write a batch program to place a white frame of a specified width around the perimeter of the images to eliminate this unwanted gray. How can I do this?

Thanks,

Tom
Find all posts by this user
Quote this message in a reply
Mar 5, 2012, 07:44
Post: #2
RE: How to place a white frame around an image?
If all your images are roughly the same size, your best friend for this isn't Gimp but ImageMagick, especially its composite command. You would create a white frame image, save it as PNG, and use composite to apply it over all you images in a command line batch (there is a user help forum on ImageMagick for the details).

To produce the frame with a transparency fading across 2N pixels:

- evaluate the size needed from your existing scan
- evaluate the size/position of the "hole"
- create an image of that size in Gimp
- "Layer/Transparency/Add alpha channel"
- Create a rectangular selection the size of the hole +N pixels (ie, where the middle of the fade will be, which is where the frame will be 50% transparent)
- "Select/Feather" and feather on N pixels
- [Delete] (you'll see the canvas background checkerboard where it is transparent)
- Save as PNG.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 5, 2012, 17:41
Post: #3
RE: How to place a white frame around an image?
ImageMagick looks like it could be useful, but I have one question: Do I download the 32 bit static or dynamic version for my Windows Vista machine?

When you say "- create an image of that size in Gimp," do you mean the size of my image or the size of the "hole?"

Thanks,

Tom
Find all posts by this user
Quote this message in a reply
Mar 5, 2012, 17:46
Post: #4
RE: How to place a white frame around an image?
The size of your image... actually the important thing is that the "hole" is big enough to contain the usable part of your scans, IM's "composite" can center the two images so the frame image can be bigger than the scans.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  "Open Image" change default folder and thumbnail view? Dave001 1 54 Aug 15, 2017 19:56
Last Post: ofnuts
  How to wrap paragraph text in an image arun67 0 44 Aug 12, 2017 12:46
Last Post: arun67
  Combining gif image to static image help? littlegreendog 1 76 Jul 26, 2017 12:27
Last Post: ythgilb
  Image color vs color picker YalithKBK 1 118 Jul 7, 2017 11:45
Last Post: ythgilb
  Print Size vs Image Size ambermc85 1 123 Jun 27, 2017 05:18
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS