Skip to content
Browse files

Added color_fix.bash script. Added readme

  • Loading branch information...
1 parent e6e4873 commit e0bb7e2762c10235f904fa86bec48d7afb1eca41 @iloveitaly committed
Showing with 94 additions and 30 deletions.
  1. +46 −21 Image2Web.xcodeproj/Mike.mode1v3
  2. +16 −9 Image2Web.xcodeproj/Mike.pbxuser
  3. 0 README
  4. +22 −0 color_fix.bash
  5. +10 −0 readme.md
View
67 Image2Web.xcodeproj/Mike.mode1v3
@@ -193,7 +193,32 @@
<key>Name</key>
<string>Default</string>
<key>Notifications</key>
- <array/>
+ <array>
+ <dict>
+ <key>XCObserverAutoDisconnectKey</key>
+ <true/>
+ <key>XCObserverDefintionKey</key>
+ <dict>
+ <key>PBXStatusErrorsKey</key>
+ <integer>0</integer>
+ </dict>
+ <key>XCObserverFactoryKey</key>
+ <string>XCPerspectivesSpecificationIdentifier</string>
+ <key>XCObserverGUIDKey</key>
+ <string>XCObserverProjectIdentifier</string>
+ <key>XCObserverNotificationKey</key>
+ <string>PBXStatusBuildStateMessageNotification</string>
+ <key>XCObserverTargetKey</key>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <key>XCObserverTriggerKey</key>
+ <string>awakenModuleWithObserver:</string>
+ <key>XCObserverValidationKey</key>
+ <dict>
+ <key>PBXStatusErrorsKey</key>
+ <integer>2</integer>
+ </dict>
+ </dict>
+ </array>
<key>OpenEditors</key>
<array/>
<key>PerspectiveWidths</key>
@@ -209,7 +234,9 @@
<string>active-combo-popup</string>
<string>action</string>
<string>NSToolbarFlexibleSpaceItem</string>
+ <string>servicesModuledebug</string>
<string>debugger-enable-breakpoints</string>
+ <string>servicesModulebuild</string>
<string>build-and-go</string>
<string>com.apple.ide.PBXToolbarStopButton</string>
<string>get-info</string>
@@ -295,7 +322,7 @@
<real>186</real>
</array>
<key>RubberWindowFrame</key>
- <string>0 124 1440 754 0 0 1440 878 </string>
+ <string>480 304 1440 754 0 0 1920 1058 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
@@ -325,11 +352,11 @@
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>279FF11E1219BB4400E0AA09</string>
+ <string>270E8C2E1281C48E009CC13C</string>
<key>history</key>
<array>
<string>279FF1181219B86C00E0AA09</string>
- <string>279FF1191219B86C00E0AA09</string>
+ <string>279FF11E1219BB4400E0AA09</string>
</array>
</dict>
<key>SplitCount</key>
@@ -341,14 +368,14 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1232, 483}}</string>
+ <string>{{0, 0}, {1232, 476}}</string>
<key>RubberWindowFrame</key>
- <string>0 124 1440 754 0 0 1440 878 </string>
+ <string>480 304 1440 754 0 0 1920 1058 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
<key>Proportion</key>
- <string>483pt</string>
+ <string>476pt</string>
</dict>
<dict>
<key>ContentConfiguration</key>
@@ -361,14 +388,14 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 488}, {1232, 225}}</string>
+ <string>{{0, 481}, {1232, 232}}</string>
<key>RubberWindowFrame</key>
- <string>0 124 1440 754 0 0 1440 878 </string>
+ <string>480 304 1440 754 0 0 1920 1058 </string>
</dict>
<key>Module</key>
<string>XCDetailModule</string>
<key>Proportion</key>
- <string>225pt</string>
+ <string>232pt</string>
</dict>
</array>
<key>Proportion</key>
@@ -387,9 +414,9 @@
</array>
<key>TableOfContents</key>
<array>
- <string>279FF10F1219B6E400E0AA09</string>
+ <string>270E8C2F1281C48E009CC13C</string>
<string>1CE0B1FE06471DED0097A5F4</string>
- <string>279FF1101219B6E400E0AA09</string>
+ <string>270E8C301281C48E009CC13C</string>
<string>1CE0B20306471E060097A5F4</string>
<string>1CE0B20506471E060097A5F4</string>
</array>
@@ -508,7 +535,7 @@
<key>StatusbarIsVisible</key>
<true/>
<key>TimeStamp</key>
- <real>0.0</real>
+ <real>310494350.30722702</real>
<key>ToolbarDisplayMode</key>
<integer>1</integer>
<key>ToolbarIsVisible</key>
@@ -527,7 +554,7 @@
<string>/Users/Mike/Work/CocoaApps/Image2Web/Image2Web.xcodeproj</string>
</array>
<key>WindowString</key>
- <string>0 124 1440 754 0 0 1440 878 </string>
+ <string>480 304 1440 754 0 0 1920 1058 </string>
<key>WindowToolsV3</key>
<array>
<dict>
@@ -557,7 +584,7 @@
<key>Frame</key>
<string>{{0, 0}, {964, 370}}</string>
<key>RubberWindowFrame</key>
- <string>288 192 964 686 0 0 1440 878 </string>
+ <string>578 372 964 686 0 0 1920 1058 </string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -565,8 +592,6 @@
<string>370pt</string>
</dict>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -576,14 +601,14 @@
<key>XCBuildResultsTrigger_Collapse</key>
<integer>1021</integer>
<key>XCBuildResultsTrigger_Open</key>
- <integer>1011</integer>
+ <integer>1012</integer>
</dict>
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
<string>{{0, 375}, {964, 270}}</string>
<key>RubberWindowFrame</key>
- <string>288 192 964 686 0 0 1440 878 </string>
+ <string>578 372 964 686 0 0 1920 1058 </string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -606,14 +631,14 @@
<key>TableOfContents</key>
<array>
<string>279FF1061219B6AC00E0AA09</string>
- <string>279FF1111219B6E400E0AA09</string>
+ <string>270E8C311281C48E009CC13C</string>
<string>1CD0528F0623707200166675</string>
<string>XCMainBuildResultsModuleGUID</string>
</array>
<key>ToolbarConfiguration</key>
<string>xcode.toolbar.config.buildV3</string>
<key>WindowString</key>
- <string>288 192 964 686 0 0 1440 878 </string>
+ <string>578 372 964 686 0 0 1920 1058 </string>
<key>WindowToolGUID</key>
<string>279FF1061219B6AC00E0AA09</string>
<key>WindowToolIsVisible</key>
View
25 Image2Web.xcodeproj/Mike.pbxuser
@@ -1,6 +1,7 @@
// !$*UTF8*$!
{
08FB7793FE84155DC02AAC07 /* Project object */ = {
+ activeArchitecturePreference = i386;
activeBuildConfigurationName = Release;
activeExecutable = 279AAAA00DD4C62600EF8D6C /* Image2Web */;
activeSDKPreference = macosx10.6;
@@ -71,12 +72,12 @@
PBXFileDataSource_Warnings_ColumnID,
);
};
- PBXPerProjectTemplateStateSaveDate = 303675107;
- PBXWorkspaceStateSaveDate = 303675107;
+ PBXPerProjectTemplateStateSaveDate = 310492668;
+ PBXWorkspaceStateSaveDate = 310492668;
};
perUserProjectItems = {
+ 270E8C2E1281C48E009CC13C /* PBXTextBookmark */ = 270E8C2E1281C48E009CC13C /* PBXTextBookmark */;
279FF1181219B86C00E0AA09 /* PBXTextBookmark */ = 279FF1181219B86C00E0AA09 /* PBXTextBookmark */;
- 279FF1191219B86C00E0AA09 /* PBXBookmark */ = 279FF1191219B86C00E0AA09 /* PBXBookmark */;
279FF11E1219BB4400E0AA09 /* PBXTextBookmark */ = 279FF11E1219BB4400E0AA09 /* PBXTextBookmark */;
};
sourceControlManager = 279AAAA90DD4C62B00EF8D6C /* Source Control */;
@@ -85,12 +86,22 @@
};
08FB7796FE84155DC02AAC07 /* Image2Web.m */ = {
uiCtxt = {
- sepNavIntBoundsRect = "{{0, 0}, {1171, 1157}}";
+ sepNavIntBoundsRect = "{{0, 0}, {1171, 1246}}";
sepNavSelRange = "{1378, 0}";
- sepNavVisRange = "{985, 1181}";
+ sepNavVisRange = "{985, 1082}";
sepNavVisRect = "{{0, 0}, {1185, 467}}";
};
};
+ 270E8C2E1281C48E009CC13C /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = 08FB7796FE84155DC02AAC07 /* Image2Web.m */;
+ name = "Image2Web.m: 50";
+ rLen = 0;
+ rLoc = 1378;
+ rType = 0;
+ vrLen = 1082;
+ vrLoc = 985;
+ };
279AAAA00DD4C62600EF8D6C /* Image2Web */ = {
isa = PBXExecutable;
activeArgIndices = (
@@ -160,10 +171,6 @@
vrLen = 160;
vrLoc = 0;
};
- 279FF1191219B86C00E0AA09 /* PBXBookmark */ = {
- isa = PBXBookmark;
- fRef = 08FB7796FE84155DC02AAC07 /* Image2Web.m */;
- };
279FF11E1219BB4400E0AA09 /* PBXTextBookmark */ = {
isa = PBXTextBookmark;
fRef = 08FB7796FE84155DC02AAC07 /* Image2Web.m */;
View
0 README
No changes.
View
22 color_fix.bash
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ -z $1 ]; then
+ echo "No dir specified"
+ exit 1
+fi
+
+targetDir="$1"
+targetDir=${targetDir%/} # remove trailing slash if there is one
+
+# convert -colorspace RGB oldcymk.jpg jpg:newrgb.jpg
+
+find "$targetDir" -name "*.png" -or -name "*.jpg" -or -name "*.jpeg" | while read line; do
+ echo "Optimizing $line"
+ image2web "$line"
+done
+
+find "$targetDir" -name "*.png" | while read line; do
+ optipng -o7 "$line"
+done
+
+exit 0
View
10 readme.md
@@ -0,0 +1,10 @@
+#Purpose
+Alot of images I would get from designers were saved in CMYK instead of RGB, poorly optimized, or had color profiles attatched to them. Color profiles do not work consistently across browsers: removing them works best for my workflow. The easiest way I found to remove color profiles before writing this little tool was to open the image in Preview.app and save it. I noticed that the filesize was generally much smaller than the non-Preview.app saved file.
+
+I wrote this tool to convert CMYK images to RGB, strip color profiles, and get some of the file optimization benefits that Preview.app provided.
+
+#Usage
+
+ color_fix.bash ~/Sites/websites/images
+ image2web ~/Sites/websites/images/background.jpg
+ image2web ~/Sites/websites/images/tile.png

0 comments on commit e0bb7e2

Please sign in to comment.
Something went wrong with that request. Please try again.