Set the screen shot feature at low def
How are one supposed to do to set the Mac's screen shot feature at low def or at least being able to set ourself the quality please ?
How are one supposed to do to set the Mac's screen shot feature at low def or at least being able to set ourself the quality please ?
I post process my screenshots using /usr/bin/sips, but it is a bit ugly
I created an Automator app using "Take Screenshot", then pass control to a bit of shell script that converts the image to a 72 pixels/inch. It could be be converted to any pixel/inch density you desire, just modify the shell script's DPI variable.
This first part is from the Automator app, the second part is the complete shell script in the 2nd Automator box.
This is the part that goes into the "Run Shell Script" section.
# Rescale image(s) to 72 dpi (dots/inch; aka pixels/inch)
# The pixel width and height is also scaled, so that the image should appear
# to be the same size when displayed, but just have less resolution.
DPI=72
in="${HOME}/Desktop/72dpi_Snapshot.png"
n=0
while /usr/bin/true
do
n=$((n+1))
out="$(/usr/bin/dirname "${in}")/$(/usr/bin/basename "${in%.png}")_${n}.png"
[[ ! -e "${out}" ]] && break
done
#/Users/raharris/tmp.png
# pixelWidth: 512
# pixelHeight: 512
# typeIdentifier: public.png
# format: png
# formatOptions: default
# dpiWidth: 96.000
# dpiHeight: 96.000
# samplesPerPixel: 4
# bitsPerSample: 8
# hasAlpha: yes
# space: RGB
# profile: sRGB IEC61966-2.1
while read line
do
set -- ${line}
[[ "$1" = pixelWidth: ]] && wpix=$2
[[ "$1" = pixelHeight: ]] && hpix=$2
[[ "$1" = dpiWidth: ]] && wdpi=$2
[[ "$1" = dpiHeight: ]] && hdpi=$2
done < <(/usr/bin/sips -g all "${in}" 2>&1)
wpix=${wpix%%.*}
hpix=${hpix%%.*}
wdpi=${wdpi%%.*}
hdpi=${hdpi%%.*}
w=$(( (wpix * DPI) / wdpi ))
h=$(( (hpix * DPI) / hdpi ))
/usr/bin/sips -s dpiHeight $DPI -s dpiWidth $DPI -z $h $w "${in}"
I post process my screenshots using /usr/bin/sips, but it is a bit ugly
I created an Automator app using "Take Screenshot", then pass control to a bit of shell script that converts the image to a 72 pixels/inch. It could be be converted to any pixel/inch density you desire, just modify the shell script's DPI variable.
This first part is from the Automator app, the second part is the complete shell script in the 2nd Automator box.
This is the part that goes into the "Run Shell Script" section.
# Rescale image(s) to 72 dpi (dots/inch; aka pixels/inch)
# The pixel width and height is also scaled, so that the image should appear
# to be the same size when displayed, but just have less resolution.
DPI=72
in="${HOME}/Desktop/72dpi_Snapshot.png"
n=0
while /usr/bin/true
do
n=$((n+1))
out="$(/usr/bin/dirname "${in}")/$(/usr/bin/basename "${in%.png}")_${n}.png"
[[ ! -e "${out}" ]] && break
done
#/Users/raharris/tmp.png
# pixelWidth: 512
# pixelHeight: 512
# typeIdentifier: public.png
# format: png
# formatOptions: default
# dpiWidth: 96.000
# dpiHeight: 96.000
# samplesPerPixel: 4
# bitsPerSample: 8
# hasAlpha: yes
# space: RGB
# profile: sRGB IEC61966-2.1
while read line
do
set -- ${line}
[[ "$1" = pixelWidth: ]] && wpix=$2
[[ "$1" = pixelHeight: ]] && hpix=$2
[[ "$1" = dpiWidth: ]] && wdpi=$2
[[ "$1" = dpiHeight: ]] && hdpi=$2
done < <(/usr/bin/sips -g all "${in}" 2>&1)
wpix=${wpix%%.*}
hpix=${hpix%%.*}
wdpi=${wdpi%%.*}
hdpi=${hdpi%%.*}
w=$(( (wpix * DPI) / wdpi ))
h=$(( (hpix * DPI) / hdpi ))
/usr/bin/sips -s dpiHeight $DPI -s dpiWidth $DPI -z $h $w "${in}"
I decided to do some search on the side, and I did find this which is a simpler Automator script
On non-retina Macs, the default screen capture resolution is 72 dpi. That is low enough. I don't have a retina Mac here to test, so don't know if the default screen shot remains 72 dpi, or 144 dpi. If the latter, then Bob's suggestion for the built-in sip utility will allow you to adjust the screencapture resolution to 72 dpi.
Get a 3rd party app. Use Applications -> App Store and search for "picture resize" and you will find a bunch of apps, many of them free.
In my above Automator example above all the sips action happens in a double-clickable app.
That is to say, you double-click on the app created by Automator, it prompts you to choose what you want to select, then it post-processes the screenshot via sips, all within the Automator app you create.
If you want to manually run sips from a Terminal session that is perfectly OK. I write my Automator based app to avoid manually running sips at the command prompt in a Terminal session.
The "man sips" command gives you instructions on how to use sips.
A Retina Macbook Pro gives 144 pixels per inch, and when you post that anywhere they look huge.
Most of my screenshots end up in these forums on in emails to family members or co-workers when I'm explaining something and a screenshot helps the explanation.
For example: 72dpi
vs 144dpi
Late 2016 15" Macbook Pro Retina
sdpi.py
Display Size: 1680x1050
Effective Res. (ppi): 260
So Apple is adjusting the screenshot resolution down to 144ppi
And my above script adjusts it down to 72ppi, which seems to make most screenshots displayed via web browsers appear normal.
Where can i find "/usr/bin/sips," please ?
/usr/bin/sips is an Applications -> Utilities -> Terminal command. Use the command:
man sips
to find out more information about the sips command
It is not a GUI based app.
But to find it from the Finder you could use:
Finder -> Go -> Go to folder -> /usr/bin
I have checked, and it exists on systems as far back as Snow Leopard 10.6.8. If you have something older, I do not know if it exists or not, as I do not have access to any systems older than Snow Leopard.
Thanks a lot Bob !! Do we have to go in Terminal app once for all or each time for each screen shot please ?
So i open Terminal then click on Menu Shell then "new command" then i type "man sips" then i type "run" and i am all good ?
Bob,
Wrote this a couple of weeks back:
#!/usr/bin/python
# coding: utf-8
# show the screen size w x h and the effective resolution in ppi
from AppKit import NSScreen
from Quartz import CGDisplayScreenSize
import math
import sys
def main():
# 1.0 unless retina which is 2.0
scr_factor = NSScreen.mainScreen().backingScaleFactor()
scr_desc = NSScreen.mainScreen().deviceDescription()
displayPixelSize = scr_desc['NSDeviceSize'].sizeValue()
displayPhySize = CGDisplayScreenSize(scr_desc['NSScreenNumber'].
unsignedIntValue())
ppi = (displayPixelSize.width / displayPhySize.width) * 25.4
print("Display Size: {0:g}x{1:g}".format(displayPixelSize.width,
displayPixelSize.height))
# round up to nearest ten
ppi = (math.ceil(ppi / 10.0) * 10.0) * scr_factor
print("Effective Res. (ppi): {0:g}".format(ppi))
if __name__ == '__main__':
sys.exit(main())
And on a non-retina Mac:
error
Where can i find "/usr/bin/sips," please ?
Thanks but it does not answer to my previous question... ^^
Ok seems too complicated for me to program automator, i thought i could enter a command in Terminal or something but i'm not sure it its possible from the mathematic attack you throw at my eyes ^^
So no easy solution guys ?
Set the screen shot feature at low def