Hi, Thomas RIBO <tharibo@xxxxxxx> writes: > > - average() and variency both use a wrong index into the data > > array thus accessing the wrong data. Your loops should go from > > 0 to width/height, not from x to x + width, resp. y to y + height > > Ok for this. I couldn't know. well, yes, you could have known ;-) It would really help if someone would go through the hassle of adding more documentation to libgimp. I would help with gtk-doc questions but I don't have time to do the full job... > > and using region->rowstride and region->bpp here does not make > > sense. > > Why doesn't it make sense here? Are they undefined here or is this just > because I'm only working on graylevels and only access data byte per > byte? since you have called gimp_pixel_rgn_get_rect() which copies the pixel data into the memory you've allocated. Thus, the data is not row-aligned. Using region->bpp makes sense, but then you also need to respect bpp when allocating memory or gimp_pixel_rgn_get_rect() will write out of bounds. > I have another question : the plugin currently do not work for the > reason that my writes in the output image are taken into account (or > seem not to... ;-) you need to call gimp_drawable_detach() when you are done with the drawable which should cause all tiles to be flushed back to the gimp core (gimp_drawable_detach calls gimp_drawable_flush for you). Salut, Sven