Description: A script to remove gamma information and other fancier color space information from PNG images.
Requirement: Mac OS 10.3+ and pngcrush (get it via Fink)
Background: The Sad Story of PNG Gamma “Correction"

Open in the Script Editor

-- Script Start
(*
  Remove gamma information and other fancier color space information from PNG images.
  2006-09-29 by Fredrik Jonsson <mailto(colon)fredrik(at)combonet(dot)se>
  home page <http://xdeb.org/wiki/AppleScript>
*)
 
property pngcrush_cmd : "/opt/local/bin/pngcrush" -- DarwinPort
-- property pngcrush_cmd : "/sw/bin/pngcrush" -- Fink
 
try
  tell application "Finder"
    copy selection as alias to thePath
    set thePath to quoted form of POSIX path of thePath
    do shell script "/bin/mv " & thePath & " " & thePath & "~"
    do shell script pngcrush_cmd & " -q -rem gAMA -rem cHRM -rem iCCP -rem sRGB " & thePath & "~ " & thePath
  end tell
end try
-- Script Stop
 
applescript/pnggammafix.txt · Senast uppdaterad: 2007-07-07 16:02 av frjo
 
Recent changes RSS feed Creative Commons License Driven by DokuWiki