vips not rendering 16-bit greyscale tiffs properly to png
Closed, ResolvedPublic

Description

Bawolff created this task.Oct 28 2015, 6:12 PM
Bawolff added a subscriber: Bawolff.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 28 2015, 6:12 PM
Restricted Application added a subscriber: Matanya. · View Herald TranscriptOct 28 2015, 6:12 PM

Its probably related to the tiff being 16bit. Probably there is a bug in converting that to 8 bit png. Probably could be fixed by adding an explicit conversion step.

Also appears to be somewhat of a regression. Bug is not apparent on vips-7.38.5. At least locally.

vips im_clip2fmt in.v out.png 2

seems to fix issue.

Also appears to be somewhat of a regression. Bug is not apparent on vips-7.38.5. At least locally.

I wasn't testing locally properly. It is reproducible locally.

Change 249676 had a related patch set uploaded (by Brian Wolff):
Make vips reset bit-depth after convolution. (Fix 16 bit tiff)

https://gerrit.wikimedia.org/r/249676

Bawolff changed the title from "vips not rendering some tiffs properly to png" to "vips not rendering 16-bit greyscale tiffs properly to png".Oct 29 2015, 4:59 AM
Kelson added a subscriber: Kelson.Oct 29 2015, 10:00 PM

Change 249676 merged by jenkins-bot:
Make vips reset bit-depth after convolution. (Fix 16 bit tiff)

https://gerrit.wikimedia.org/r/249676

Bawolff closed this task as "Resolved".Nov 1 2015, 9:17 AM
Bawolff claimed this task.

These images should be fixed starting on Wednesday (Thursday for wikipedia).

MediaWiki caches images. Thus for older images you might not see the fix until someone purges them (Adds ?action=purge to the end of the url of the image description page).

jcupitt responded upstream, and says another work around is to use integer convolution instead. e.g.

vips conv shrunk.v x.png sharpen_int.mat

with the matrix being:
5 5 131 0
0 0 -1 0 0
0 -5 -11 -5 0
-1 -11 199 -11 -1
0 -5 -11 -5 0
0 0 -1 0 0

Just as a point of interest, the only thing left in https://commons.wikimedia.org/wiki/Category:TIFF_files_affected_by_MediaWiki_restrictions that legitimately should be in there (afaik) is

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 5 2015, 7:43 AM
matej_suchanek removed a project: Patch-For-Review.
matej_suchanek moved this task from To Triage to In current Tech/News draft on the User-notice board.
matej_suchanek removed a subscriber: gerritbot.