0

I want to cut out unwanted full height or full width portion of an image. For example, in below gif image, I'm cutting out unwanted full height portion from the image. How to do this in PhotoShop or Gimp? I have both software installed and I will choose which one is simpler.

enter image description here

Update

The use case is when you want to remove part of unwanted of an image. For example, if I have this image: enter image description here And I want paste it to my note app or a Word document. I can make it more compact like this:

4
  • 2
    I'm very curious what the use case is. Surely you're not just cutting buildings in half for no reason? There must be some very specific use case if someone built a tool to split images this way, but I wonder if this is just a quick way to split and then you'd start the work of repairing the image with like a clone stamp or something... or is this the intended result? Photoshop has a tool called "content aware scale", which kind of does the same thing, but rather than making hard cuts like in your gif, it tries to add or remove sections of the image while trying to preserve "important" areas.
    – Joonas
    May 2, 2022 at 7:00
  • Generally you just drag the scaling handles to stretch or squish and it tries to figure it out by itself, but you can use masks to protect certain areas too. I don't know if that's too different from what you want. Most examples of this content aware scale are about extending photos, but I found this post where a few paragraphs below there's a good screenshot showing regular old photo squish in the middle and content aware squishing on the right.
    – Joonas
    May 2, 2022 at 7:01
  • Here's a pretty good video showing the squishing as well: youtu.be/nWK5cpn3ipY?t=160
    – Joonas
    May 2, 2022 at 7:08
  • @Joonas I've updated the question and described the use case in the question. Thanks for the link and I'll take a look. May 2, 2022 at 13:28

2 Answers 2

3

In Photoshop you could record an action that does what you want.

First make a selection in the full height of the image and make sure it doesn't touch the left or right side of the image (the action will only work for selections that don't touch the sides).

Make a new action and record the following:

  • Perform Layer > New > Layer Via Cut to make a new layer only containing the middle part of the image.
  • Ctrl / Cmd + click the thumbnail of the new layer to get back the initial selection.
  • Perform Select > Transform Selection, set the anchor to the right side and set W (width) to a large negative number like -1000000%. Photoshop will correct this number to the largest negative value allowed. This will select the right part of the image.
  • Select the background layer.
  • Perform Layer > New > Layer Via Cut to make a new layer only containing the right part of the image.
  • Ctrl / Cmd + click the thumbnail of the layer with the middle part of the image.
  • Shift + Ctrl / Cmd + click the thumbnail of the layer with the right part of the image to select a union of those two layers.
  • Perform Select > Inverse to select the left part of the image.
  • Select the background layer.
  • Perform Layer > New > Layer Via Cut to make a new layer only containing the left part of the image.
  • Select the layer with the right part of the image.
  • Hold Ctrl / Cmd and select the middle part of the image. You should now have both layers selected.
  • Switch to Move Tool and click the Align left edges button in the top to align the middle part of the image with the right part of the image.
  • Hide the layer with the middle part of the image.
  • Ctrl / Cmd + click the thumbnail of the layer with the left part of the image.
  • Shift + Ctrl / Cmd + click the thumbnail of the layer with the right part of the image to select a union of those two layers.
  • Perform Image > Crop to crop the image to only contain the left and right part of the image.
  • Perform Layer > Flatten Image to get rid of the new layers created along the way.
  • Perform Select > Deselect to end up with no selection.

The action should perform like this:

9
  • Thank you for the answer! This is what I need. May 2, 2022 at 17:24
  • @FajelaTajkiya, not to take away from the answer, like, without really reading through the steps, I'm sure it's just about as efficient and handy you can get in PS... Great! ...but given you chose this as the correct answer, how is this better from what you were already doing in the gif? I guess I could see how in PS you might have more control over the final image and maybe if you're working with print quality images PS would have the edge even more, but a click at any vertical point followed by a horizontal drag (like in your gifs) seems more efficient than this, right?
    – Joonas
    May 2, 2022 at 19:06
  • @Joonas You are right, but the problem is that the software in my gif is expensive and I don't want to buy it. I already have PhotoShop. So I'd like to use existing software to do it. May 2, 2022 at 19:09
  • 1
    That said, looking at my own gif I wonder if it would be easier just to just use browser dev tools to squish the table using CSS...? Chrome dev tools even has a node screenshot functionality so you wouldn't need to crop it afterwards.
    – Joonas
    May 2, 2022 at 19:43
  • 1
    @Joonas, yes totally. I didn't think the tables could be from the web. Could just set a low padding and that's it. Or copy paste the content and make your own table.
    – Wolff
    May 2, 2022 at 19:46
1

If you want a similar result to the example you posted, then there's no tool to automate this in Photoshop or GIMP like in your example. You'd need to do it manually: Cut a portion of an image, paste as a new layer, reposition it, and then crop the image.

However, I honestly can't see the point in cutting up an image like your example - it will look absolutely terrible. If your goal is to change the aspect ratio of an image without distorting the content too much, there are much better ways to do this. In Photoshop you could use Content Aware Scaling.

An example in Photoshop, you'd need to crop the image afterwards.

enter image description here

This is also possible in GIMP using the Liquid Rescale plugin. After installation, restart GIMP. Then you open the plugin using the main menu Layer > Liquid Rescale, go into the Interactive Mode, and type in a new image width. No need to crop separately here, as the plugin does it for you. There's also a protected areas mask if you want to tweak this for optimal results

enter image description here

1
  • Thanks for the answer and I'll give it a try. I've updated the question and clarified the use case. May 2, 2022 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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