Saturday, October 30, 2010

Tile Cutter Updated

Had to re-tile a large image, so spent a bit of time converting tile cutter to use NSOperationQueue. After a little playing, I opted for one operation per row, which seems to give the best all-around performance for the widest variety of images. You can download the latest version from here, or pull the source from GitHub.

For those of you having trouble running the application, I've also added i386 to the supported architectures. Because of my use of blocks, Snow Leopard is required to run the app.



6 comments:

Jim said...

If you're using blocks anyway, I'd suggest some judicious use of GCD rather than NSOperationQueue; it depends on the number of operations, but I've found that GCD is a *ridiculous* order of magnitude faster when looking at over 1000 operations, especially if you then need to feed updates to a UI thread to match.

Jeff LaMarche said...

Jim:

I actually started down the GCD route first, but once I decided to chunk it by rows instead of by tile, NSOperation became more appealing. Given that few images will be create more than a dozen operations, I don't think the overhead is going to be measurable in most cases.

Jeff

cindy said...

I'd suggest some judicious use of GCD rather than NSOperationQueue; it depends on the Hot Rolled Steel Plate number of operations, but I've found that GCD is a *ridiculous* order of magnitude faster when Channel Bar Section Steel looking at over 1000 operations, especially ASTM Equal Angle Bar if you then need to feed updates to a UI thread to match.

HandbagsGirl said...

Great post!Keep on posting!!!
2945abc45 0120

cheap purses

designer wallets

Cheapsocceruniforms said...

There are many brand from France, also including herve leger, and most of womens stars love wearing herve leger dress when they join in some important party. Now polo ralph lauren is very popular with youthful people, everyone want to get ralph lauren polo shirts, there are lots of online shop which are ralph lauren polo outlet, true religion jeans outlet, it will be convenient for us.

Joris said...

There is an error in your code:

for (int column = 0; column < [imageRep pixelsWide] / tileWidth +1; column++)

in TileOperation.m should be:

for (int column = 0; column < [imageRep pixelsWide] / tileWidth + (([imageRep pixelsWide] % tileWidth) ? 1 : 0); column++)

otherwise if the image is an exact multiple of the tilesize you try to go one tile too far..