2008.01.21 19:38 "[Tiff] How to clip an image with LibTiff", by

2008.01.24 12:35 "Re: [Tiff] Change single pixels in a tiled Tiff-image", by Andy Cave

You could do that, but how you do it really depends on what you want to do. If you only want to change a single pixel, then doing the below is fine. If you want to change lots of pixels, then doing the below would be really slow, as there would be loads of overhead in it. In that case you might want to batch / buffer up a number of pixel changes before committing them to the file. If you want to modify the whole image, you'd be better of streaming over the image. Etc...



----- Original Message -----

On Wed, Jan 23, 2008 at 09:18:06PM +0100, Timur Ametov wrote:

I have another question. Can (or how can) I change single pixels in a tiled TIFF-Image.

I have only one idea how can I do this:

  1. read a tile, where the pixel is, into buffer
  2. change the pixel
  3. rewrite tile

but maybe there are another solutions?

In case of uncompressed tile you can try to overwrite the pixel yourself using TileOffsets table to get the data disk layout. But do not forget that the tile can be compressed and you need to decompress it to get access to individual pixels.