Very interesting, thank you. Although I think the PIL documentation is quite excellent, there are a few aspects of PIL that have always been unclear to me, and the tile attribute is one of them. This actually works really well for me because I am calling crop many times, so perhaps I can easily add (or replace crop with) this tile approach--I hope. I will try this approach very soon and respond to the list again with my results.
So it also sounds like this only works for uncompressed images, and that somehow checking for this is a good idea? Sorry for such basic questions, this kind of image processing is still pretty new to me. Fredrik Lundh said: > Adam J Smith wrote: > >>>following up to the response you got may also be a good >>>idea: >> >> My apologies, I see that I accidentally replied to your personal email >> instead of the list. > > that's not a problem in itself, but I never got it (from what I can tell). > probably a spam filter issue :-( > >> Here is it again. Does this help? > > this shows that the image is sliced and uncompressed, which means > that you should be able to read the image piece by piece simply by > manipulating the contents of the "size" and "tile" attributes before you > load the image. > > I don't have time to dig up a tested example right now, but here's an > "off the top of my head and completely untested" outline: > > im = Image.open(...) > tiles = im.tile > > for tile in tiles: > > # get the tile parameters > layout, extent, offset, args = tile > > # where in the image should this data go > x0, y0, x1, y1 = extent > > assert layout == "raw" > > im = Image.open(...) > > # read a single tile > im.size = x1-x0, y1-y0 > im.tile = [(layout, (0, 0) + im.size, offset, args] > > ... process the image ... > > to speed things up, you may want to process multiple tiles in each > iteration > (to get this right, you need to calculate a proper size for a group of > tiles, and > set the tile extent properly for each subtile). > > </F> > > > > > ____________________________ adam smith [EMAIL PROTECTED] 255-8893 215 ccc _______________________________________________ Image-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/image-sig
