When using ROI to extract part of a large image, the resulting image gets corrupted somehow. The image is still recognizable, but is covered with brightly coloured blotches, and random noise. The problem only seems to occur on images larger than 4096x4096 pixels, and can be demonstrated using the pre-compiled pgfconsole tool.
eg: pgfconsole -d -rect 0 0 256 256 ROIimage.pgf out.png
If ROIimage.pgf was 4096x4096, then all works fine, but for most larger images, out.png will be covered in streaks and bright coloured patches. (I have one test image of 8192x8192 where ROI works correctly, but this is an exception.)
However, if I skip the -rect parameter, and decode the entire image, the output is fine. So the problem only happens when using ROI to extract sub regions.
I'm using libPGF v.6.14.12, compiled with GCC on Ubuntu 14.02, but the problem also occurs with the pre-compiled win32 pgfconsole app from the download area. The problem occurs with Gray16 and RGB Colour images, and probably also with other formats.
Please let me know if you would like me to provide test images to demonstrate the problem?
The two attached images show what the corruption looks like.
I took a 6000x6000 image, and cropped it to 4096x4096, and encoded both to PGF.
I then extracted a 256x256 area from both, using pgfconsole.
tile.png shows a corrupted image, extracted from the 6000x6000 image.
tile2.png shows the same area, extracted from the 4096x4096 image.
They should look identical, but clearly tile.png is corrupted.
Hi Rene
Thank you for your detailled bug report. I will check the problem and try
to fix it as soon as possible.
Chris
Quoting Rene Lindsay rjklindsay@users.sf.net:
Links:
[1] http://sourceforge.net/p/libpgf/bugs/9
Hi Rene
Today I've tried to reproduce your error with a self created png rgb imge
of size 6000x6000, but I couldn't reproduce it with the WIN32 console
application. I've attached my test image. Please make the same tests with
my test image on your platform and send me also your test image.
Chris
Zitat von Rene Lindsay rjklindsay@users.sf.net:
Links:
[1] http://sourceforge.net/p/libpgf/bugs/9
Hi Chris,
Thanks for your quick reply. Your test image works fine for me.
How about I send you MY test image, which fails. (see attachment)
The command I use is:
pgfconsole -d -rect 0 0 256 256 texture6000.pgf out.png
The resulting image is corrupted.
However if I skip the -rect parameter, the whole image extracts correctly.
Thanks,
Rene
Hi Rene
Thank you for your test image. I can reproduce your bug. The pgf image is
valid, so the problem is in the ROI decoder. If I use your image data and
produce a pgf image with 7 instead of 6 levels, then the degradiation is
less, but it is still there.
Chris
Quoting Rene Lindsay rjklindsay@users.sf.net:
Links:
[1] http://sourceforge.net/p/libpgf/bugs/9
Last edit: Christoph Stamm 2015-06-20