Mobile app version of vmapp.org
Login or Join
Jessie844

: How to stretch the middle section of an image to a new width in Gimp First off, I don't use Gimp that often, so what I'm asking may be simple and I've missed something obvious. But...

@Jessie844

Posted in: #Gimp

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



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

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Jessie844

3 Comments

Sorted by latest first Latest Oldest Best

 

@Merenda852

A quick way to stretch the middle in the general case


Image>Canvas size to set the width
duplicate the layer
move one of the layer so that its end is at 500
make a rectangular selection on the full height, over a small part of the
middle of the image
copy to clipboard
make the rectangle selection cover the whole image except the half circles at the end (no need to be accurate)
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.

10% popularity Vote Up Vote Down


 

@Cody3331749

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.

10% popularity Vote Up Vote Down


 

@Vandalay110

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:


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


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


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


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




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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme