8

I asked a similar question on Programming Puzzles & Code Golf, but I'd require a version with a bit usability.

Here's what the software shall do:

  • get screenshots from clipboard
  • open screenshots from disk
  • automatically remove parts of a screenshot that is not relevant. I don't want to do this manually like today. It's too much effort.
  • provide a UI for changing the parameters (if any) and previewing the result
  • copy the result to clipboard
  • save the result to a file
  • work on Windows
  • work offline
  • cost less than 50 USD, no annual fees, no PC-related DRM

The program needn't necessarily

  • deal with aero / glass effects

The program needn't

  • have image editing functionality
  • capture screenshots itself (I'll use Windows' built-in PrintScr key)

The reason I need this:

When I ask for screenshots, people take screenshots of their desktops, which are 1920x1080 nowadays. I need to present them on beamers which sometimes can only handle 1024x768. As a result, the important things of the screenshot become unreadable.

In many cases, applications aren't designed for 1920x1080 and there's a lot of unused space which can be removed.

Examples:

Before:

Screenshot with huge space

Removable areas (highlighted manually):

Removable areas

After:

Screenshot after removing irrelevant areas

2
  • Try Greenshot (getgreenshot.org). You can edit whatever is in the clipboard or save it to a file for later editing. Don't think you will find something that would automatically remove unused areas because "unused" is subjective.
    – user25250
    Jul 19, 2016 at 13:49
  • 3
    @sorinc: Not that subjective actually. There are tools designed to do this kind of things automatically, see en.wikipedia.org/wiki/Seam_carving
    – Nicolas Raoul
    Jul 20, 2016 at 1:21

1 Answer 1

1

Greenshot has a built-in Auto-Crop feature, but it only works when the background is a uniform color.

However, Greenshot does have an "External Commands" plugin, which you can use to run one of the scripts from your code golf question.

Here's an updated version of @DenDenDo's delrows Python script:

#delrows.py, from DenDenDo at https://codegolf.stackexchange.com/a/46964

import imageio
from matplotlib import pylab
from pylab import *
from sys import argv
from subprocess import call

threshold = int(argv[2])

def delrows(im, threshold):
    d = diff(im, axis=0)
    mask = where(sum((d!=0), axis=(1,2))>threshold)
    return transpose(im[mask], (1,0,2))

im7 = imageio.imread(argv[1])
newFile = argv[1] + "_" + argv[2] + ".png"
file = imageio.imwrite(newFile, delrows(delrows(im7,threshold),threshold))
call(["C:\Program Files\Greenshot\Greenshot.exe",newFile])

Setup (Windows)

  1. If necessary, replace C:\Program Files\Greenshot\Greenshot.exe in the last line of delrows.py with the actual path of greenshot.exe.

  2. Save the script, e.g. C:\Programmes\seam-carving\delrows.py.

  3. Install Greenshot and Python 3.

  4. Install the needed Python modules with Pip:

    pip install imageio matplotlib pillow numpy
    
  5. Click the Greenshot icon in the notification area and go to "Quick Preferences" > "Destination" > "Open in Image Editor".

  6. Click the Greenshot icon in the notification area again and select "Configure External Commands."

    "Configure External Commands" in the Greenshot system tray menu

  7. Click "New".

  8. For "Name", enter "Auto-Chop".

  9. For "Command", enter the full path to python.exe, e.g. C:\Python37\python.exe

  10. For "Argument", enter the full path to delrows.py, in quotation marks, followed by a space, "{0}", space, and the threshold value. For example:

    "C:\Programmes\seam-carving\delrows.py" "{0}" 29
    

    (Remember, the threshold value is how many pixels can differ for two lines to be considered the same, so start small and increase as needed)

  11. Click "OK" and "OK" to save your settings.

    enter image description here

Usage

  1. Hit Print Screen and select a region of your screen to capture.

  2. The region opens in the Greenshot Image Editor. Select the "Auto-Chop" button in the toolbar at the top.

    New AutoChop button appears in toolbar of Greenshot Image Editor

  3. The script runs, and the auto-chopped screenshot opens in a new Greenshot window.

    AutoChopped image opens in new window

  4. If too much was chopped, decrease the Threshold value in step 10 of the setup. If not enough was chopped, increase the Threshold value and try again.

Features

  • Can open image files from clipboard, disk, or by capturing directly.
  • Automatically removes identical or similar columns and rows from the image.
  • Result can be copied to clipboard or saved to file.
  • Offline program for Windows
  • Gratis
  • Includes other built-in editing tools (ellipse, arrow, blur, add text, counter, etc.)

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.