skip to Main Content

I’m looking for online or free image editing tool that allows you to scale images in the way Photoshop allows by context aware scaling. Simply I want to scale a image horizontally (in x axis) without scaling the image content but filling the added space with the image background color.

2

Answers


  1. I’m not 100% certain I understand your description, but you can do the following with ImageMagick which is installed on most Linux distros and is available for free for macOS and Windows.

    Just in the Terminal, you can take the right-most column of an image and replicate a few hundred times to make the image wider.

    So, if you start with this:

    enter image description here

    and run this:

    convert start.png -gravity east ( +clone -crop 1x+0+0 -duplicate 400 ) +append result.png
    

    You’ll get this:

    enter image description here


    Or, you could grab the colour of the pixel at the top-left (or any other) corner and extend the background using that:

    # Get colour of top-left pixel
    tl=$(convert start.png -colorspace rgb -format "%[pixel:p{0,0}]" info:)
    
    # Keeping original image at West side, extend image to East using colour found above
    convert start.png -background  "$tl"  -gravity west -extent 1000x result.png
    

    enter image description here

    Login or Signup to reply.
  2. I thought the OP was looking for “liquid image rescale” or a similar sounding name but rereading your post probably not. I do not understand why you need “context aware scaling”.

    Imagemagick can do it but it is a bit basic; it is command line and there is no easy way to protect certain areas: http://www.imagemagick.org/Usage/resize/#liquid-rescale

    Gimp has a plugin but I have never used it: http://liquidrescale.wikidot.com/en:examples

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search