8

First off, I don't use Gimp that often, so what I'm asking may be simple and I've missed something obvious. But...

enter image description here

I'm trying to modify the following image in Gimp. The image size is 489x63 however I need it to be 500x20 but most importantly I need each end to remain the same shape without distorting (i.e a perfect semi circle). If I scale (unlinked) to the required size the ends distort an become squashed.

I've tried scaling (linked) to the correct height 20px which makes the width 155px, but then I couldn't figure out how to essentially stretch the middle section until the width was 500px.

Any help appreciated

12

Gimp is not the best solution for distorting/stretching simple geometrical objects. This be done better with a vector graphics application, e.g. Inkscape.

Nevertheless it is possible with Gimp but it will take a little more time:

  1. Scale image to the desired height but keep aspect ratio
  2. Use the crop tool with "allow growing" option to enlarge the canvas to the desired width

    Enlarged canvas with empty space

  3. Select the right end of the bar with a floating selection.

    Selecting right end of the bar

  4. Move this selection to the ríght leaving the center blank (hold Ctrl for horizontal move only)

    Moving selection the the right

  5. Create another selection, now of the center bar to copy and paste it several times to fill the center.

    Filling in the center with copy-paste

Of course we could also just scale that selection width but pasting it several times is faster

  • 3
    During this approach, it is advisable to place the ends and the middle on newly created layers each (in this case, you'd end up with 3). Subsequent changes of the length will then be much easier to perform, and might even become a Scale operation for the middle part. – Michael Schumacher Sep 28 '17 at 13:47
1

A quick way to stretch the middle in the general case

  1. Image>Canvas size to set the width
  2. duplicate the layer
  3. move one of the layer so that its end is at 500
  4. make a rectangular selection on the full height, over a small part of the middle of the image
  5. copy to clipboard
  6. make the rectangle selection cover the whole image except the half circles at the end (no need to be accurate)
  7. bucket-fill the selection with the "Clipboard" pattern.

Of course on the image at hand it is simpler, after you have moved one of the layers to the right edge, you delete the tip of the top layer that overlays the other.

0

You can scale the whole image by the factor 20:63. This will preserve the semicircles. Then split the image into three parts. The middle part must not reach into the curved ends. Then you can stretch the middle part in x direction so that the whole image has a width of 500 pixels. Then combine the three layers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.