Archive for the 'Photoshop' Category

New utility: image

Friday, November 17th, 2006

When I was writing “The fun of length-declared strings”, I needed to resize that lightbulb photo down to something more suitable for a blog post. Normally, I’d just use Photoshop, but I’m not on a PowerPC Mac anymore, so Photoshop 5.5 won’t run. So I needed to use other things.

The crop was easy; Preview can do that. But I also needed to scale it, and Preview can’t do that. I tried installing the (sigh) Photoshop CS2 tryout, but that didn’t work; the installer fails while it’s doing something ambiguous to Photoshop’s help files. No surprises there.

And I didn’t want to use iPhoto for it. That would mean importing it into my Library, and I only want to do that for my photos.

The alternatives are sips and GIMPShop. I passed on sips because I don’t know how sips scales images (i.e. which interpolation quality it uses), and because it makes you specify the dimensions backward for no obvious reason. GIMPShop is out of the question because (1) it is slow, and (2) it is an X11 application, and I do not like running X11 applications on my shiny Aqua desktop.

This left only one solution: Write my own. So that’s exactly what I did.

Introducing image. image is a utility that can both scale and convert images; this includes rasterization of vector art. Here are the examples from the webpage:

  • % image piechart.eps pdf
    Output: piechart.pdf
  • % image lightbulb.jpg 50%
    Output: lightbulb-50%.jpg
  • % image lightbulb.jpg 240
    Output: lightbulb-240.jpg (scaled proportionally)
  • % image lightbulb.jpg 320x240
    Output: lightbulb-320×240.jpg
  • % image lightbulb-orig.tiff 50% jpg lightbulb.jpg
    Output: lightbulb.jpg

Pretty useful, huh? I hope so.

Enjoy.

How to make Photoshop open your EPS file

Sunday, May 14th, 2006

Sometimes, when I want to draw a graphic, I write it instead. I write it in PostScript, as an EPS file, and then convert to whatever destination format I want.

The problem with this plan is that I was never able to get Photoshop to import the EPS directly. I always got this error message:

Could not open “foo.eps” because the parser module cannot parse the file.

Finally, today, I went looking for the solution. I used strings to see what the EPS Parser plug-in looks for. I found it in under a minute.

So, at minimum, this is what your EPS file must contain:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 width height
%%EndComments

The %%EndComments line is the one that I was missing. Make sure yours isn’t missing it too.

In case you want to know more, these special comments (% is the comment character in PostScript) are defined by the Document Structuring Conventions. EPS is an application of DSC.

Technorati tags: , , , .

Photoshop sucks

Monday, February 20th, 2006

Blunt enough title for you?

I’m mainly referring to CS2. I’ve been playing with it intermittently for the past 30 days, and I have built a list of complaints, all of which together stop me from pushing $180 across the counter for the upgrade from 5.5. I mainly arrived at that decision while making the screenshots for BZ Soundboard.


Selections can’t be moved under stupid circumstances.

Namely, when the current layer is hidden, you can’t move the selection. Huh?

Can’t drag-and-drop image files into open images.

Photoshop won’t accept the drop. You’d think it would at least check the file’s name and HFS type. Even better would be to run some kind of file(1)-like scan of the file.

The app insists upon old Mac OS behavior.

Many people like the old behaviour where clicking on any window of an app would bring them all forward. And there are several hacks that bring this to Mac OS X. But this should NOT be forced in an application. Photoshop does this, and it shouldn’t.

Can’t unlink a single layer from a set of linked layers.

Instead of you have to unlink all of them at the same time. Why? Photoshop 5.5 let you do this. Why can’t CS2?

No Unicode support in text layers.

Paste this into a text layer: ☃

Oddly, it’ll show up fine in the layers list; it just won’t render into the image correctly. You get “?” instead.

Excessive use of combo boxes.

Why do I have the ability to enter text here?

Screenshot of Photoshop's ‘Character’ (text settings) palette. Highlighted is a combo-box for entering the font.

Photoshop does provide completion, which is nice, but it should still be a plain pop-up menu. I can enter font names into that with the same effect. Even better, in the Mac version of Photoshop, it should use the Font Panel.

Non-standard UI elements.

Here’s one example:

Screenshot of Photoshop's gradient editor. Highlighted is the color pop-up for a key-point in the gradient. The arrow of the pop-up is excessively large.

Notice the hugemongous arrow. And this is a pop-up menu, not a pull-down menu. You could argue that this is a combo box, but at least on OS X, combo boxes have a text field attached. This should have the double-arrows like you see in the pop-up higher in the dialog. It also needs some kind of indicator (like ‘F’/’B’) when the foreground or background color is selected, as opposed to a static color.

I don’t mind so much this being custom, but it doesn’t look or work like a native UI element.

Preferences key combo is wrong.

Since Mac OS X, it should be ⌘,. Photoshop’s default is ⌘K. I don’t know how they thought of this selection, but it’s been around forever, and should now be retired.

Stupid save bugs.

  1. You can’t Save A Copy of a file, in PNG format, with alpha. But you can Save it As, in PNG format, with alpha. Huh?
  2. If you Save a file As in PNG format, then the window changes to reference the PNG file and the file appears saved (no “dirty” indicator in the close widget). All of this is correct. But if you then try to close the window, it’s suddenly dirty, and Photoshop complains that it “has not been saved completely because the current file format does not support all the features of your document”. Why didn’t you tell me this would happen when I saved the file?

Corrupted TIFF files.

Make sure that the “Save Transparency” checkbox in the TIFF options dialog is turned off (at least if you have an alpha channel). If it’s turned on, Cocoa can’t read your TIFF files.

No alpha support.

It is 2006, Adobe! EVERY graphics application outside of the Creative Suite supports alpha channels!

And amazingly enough, alpha support has actually regressed. Photoshop CS2 would not export the alpha of the two largest screenshots on the BZ Soundboard page (the resize screenshots). I don’t know if there is some hard-coded limit on the number of pixels that Photoshop CS2 will blend with an alpha channel, or if there’s some deeper bug, but CS2 pretended that the alpha did not exist when exporting to PNG or TIFF. I opened the PSD files in 5.5, and it exported the alpha flawlessly.


One thing I noticed while compiling this list: A number of these bugs seem to be in the class of “we’ve always done it this way”. Time for a refactor? (And I mean a real refactor, not just moving stuff around like they’ve done in every major version.)


An update (2008-03-23)

Since I originally published this post more than two years ago, several new image editors have emerged. Most people, I think, can replace Photoshop with one of these, and never miss the lost functionality.

All of these require Mac OS X 10.4 (because they all use Core Image). Prices in $ are US dollars.

  • Acorn ($50) is one of the two most popular—everybody who I know uses either Acorn or Pixelmator uses Acorn). I consider this the 21st-century update of MacPaint, and I mean that as a compliment. Start with this one—you will probably be satisfied.
  • Core Image Fun House (free) is the most basic editor you can get. It provides nothing more than filtering and cropping, and it doesn’t give you much help with the cropping (nor with scaling). However, it’s free, and you already have it: it’s one of the Mac OS X Developer Tools, as well as one of the sample-code applications.
  • Pixelmator ($59) is the most Photoshop-like, and the other most popular editor (it has the most downloads on MacUpdate and VersionTracker). If Acorn is too different from Photoshop for you, or you’re missing some of the more-advanced features, Pixelmator may be more your speed.
  • DrawIt is available in two versions: DrawIt Lite is free, whereas the full DrawIt is €29 ($42 as of this writing). It’s the most different of all the apps: The UI is essentially vector-based. The reason is that, in DrawIt, every operation is non-destructive. It accomplishes by making everything a layer. This works well, so you should definitely give DrawIt a try.
  • Iris is the only one I haven’t personally used. It’s currently a public beta; you can pre-order it for $39, or wait until version 1.0, which will be $79. The screenshot suggests that the UI is a cross between Pixelmator and Acorn.