poor image scaling for 1-bit images

Bug #486011 reported by mangtronix on 2009-11-20
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Internet Archive BookReader
High
mangtronix

Bug Description

In this spread, the right hand page seems to scale poorly, whereas the left one is better. Zoom to 25% and compare: http://www.archive.org/stream/zc-f-c-b-4/zc-fred-test#page/n1/mode/2up

mangtronix (mang) wrote :
summary: - poor image scaling for this book
+ poor image scaling for 1-bit images
Changed in bookreader:
assignee: nobody → mangtronix (mang)
importance: Undecided → High
status: New → Confirmed
mangtronix (mang) on 2009-12-09
Changed in bookreader:
milestone: none → 0.9.19
mangtronix (mang) on 2010-01-23
Changed in bookreader:
milestone: 0.9.19 → 0.9.20
mangtronix (mang) on 2010-01-28
Changed in bookreader:
milestone: 0.9.20 → 0.9.21
mangtronix (mang) wrote :

Hank writes:

Here's one that's mostly 1-bit jp2s:

http://www.archive.org/stream/legislativedocu69assegoog

The derive log at http://www.us.archive.org/log_show.php?task_id=41542509 shows which images have what depth. Search down to the ProcessJP2 module, and you'll see an image-by-image breakdown. "1" means 1-bit, "8" means 8-bit grayscale, and "c" means 24-bit color.

mangtronix (mang) wrote :

Here's a good summary of the bit depths possible (doesn't have jpeg2000):
http://www.scantips.com/basics09.html

mangtronix (mang) wrote :

Better table including jpeg2000, from Cornell Library:
http://www.library.cornell.edu/preservation/tutorial/presentation/table7-1.html

mangtronix (mang) wrote :

For jp2s we may also want to look at the ColorSpace tag, since we could have an 8-bit grayscale.

mang@home:~/public_html/imageconvert/1bit/InterplanetaryRadioCommunicationWithExtraterrestrialCivilizations_jp2
$ /petabox/sw/books/exiftool/exiftool InterplanetaryRadioCommunicationWithExtraterrestrialCivilizations_0000.jp2
ExifTool Version Number : 6.93
File Name : InterplanetaryRadioCommunicationWithExtraterrestrialCivilizations_0000.jp2
Directory : .
File Size : 37 kB
File Modification Date/Time : 2009:12:09 15:54:46
File Type : JP2
MIME Type : image/jpeg2000
Image Height : 3301
Image Width : 2542
Number Of Components : 1
Bits Per Component : 1 Bits, Unsigned
Compression : JPEG 2000
Colorspace : Grayscale
Image Size : 2542x3301

mangtronix (mang) wrote :

TIFF does it differently.

$ exiftool nybc200109_0543.tif
ExifTool Version Number : 6.93
File Name : nybc200109_0543.tif
Directory : .
File Size : 193 kB
File Modification Date/Time : 2009:01:09 05:24:44
File Type : TIFF
MIME Type : image/tiff
Image Width : 5081
Image Height : 6592
Bits Per Sample : 1
Compression : T6/Group 4 Fax
Photometric Interpretation : WhiteIsZero
Fill Order : Normal
Document Name : Standard Input
Image Description : converted PNM file
Strip Offsets : (Binary data 3550 bytes, use -b option to extract)
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 12
Strip Byte Counts : (Binary data 1985 bytes, use -b option to extract)
X Resolution : 600
Y Resolution : 600
Planar Configuration : Chunky
Resolution Unit : inches
Image Size : 5081x6592

mangtronix (mang) wrote :

PNG

$ exiftool BozorSobirkhonavodaParokandaShud.png
ExifTool Version Number : 6.93
File Name : BozorSobirkhonavodaParokandaShud.png
Directory : .
File Size : 72 kB
File Modification Date/Time : 2009:11:26 14:50:56
File Type : PNG
MIME Type : image/png
Image Width : 162
Image Height : 215
Bit Depth : 8
Color Type : RGB
Compression : Deflate/Inflate
Filter : Adaptive
Interlace : Noninterlaced
Gamma : 2.2
Software : Adobe ImageReady
Image Size : 162x215

mangtronix (mang) wrote :

exiftool not reporting bit depth for this gif. identify reports "4c" whereas usual is "256c". Previously determined that "identify" is very slow for jp2.

$ exiftool Pullimosina_pullula_wing-bw-1Bit.gif
ExifTool Version Number : 6.93
File Name : Pullimosina_pullula_wing-bw-1Bit.gif
Directory : .
File Size : 29 kB
File Modification Date/Time : 2010:01:21 23:33:03
File Type : GIF
MIME Type : image/gif
Image Width : 1044
Image Height : 488
Comment : Created with The GIMP
Image Size : 1044x488

mang@home:~/public_html/imageconvert/bitdepth
$ identify Pullimosina_pullula_wing-bw-1Bit.gif
Pullimosina_pullula_wing-bw-1Bit.gif GIF 1044x488 1044x488+0+0 PseudoClass 4c 29kb

mangtronix (mang) wrote :

Example 1-bit books to test:

http://www-testflip.archive.org/stream/zc-f-c-b-4/zc-fred-test#page/n1/mode/2up
http://www-testflip.archive.org/stream/legislativedocu69assegoog

Yiddish Book Center 1-bit tiffs:
http://www-testflip.archive.org/details/nationalyiddishbookcenter

1-bit books should look reasonable at all zoom levels. Random sampling of other books on www-testflip.archive.org should show no change!

Changed in bookreader:
status: Confirmed → Triaged
raj (raj-archive) wrote :

The three testflip books above work well on OSX 10.6.2/Safari 4.0.3

raj (raj-archive) wrote :

Also works well on osx 10.6.2/Firefox 3.5.8

mangtronix (mang) wrote :

Working on IE8/XP.

mangtronix (mang) wrote :

Regression tests pass on IE.

mangtronix (mang) on 2010-03-09
Changed in bookreader:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers