Page MenuHomePhabricator

Overly blurry JPG thumbnail for a specific JPG image due to chroma-subsampling not working in CMYK
Open, Needs TriagePublic

Description

https://en.wikipedia.org/wiki/File:Smileyface.jpg

https://upload.wikimedia.org/wikipedia/en/thumb/6/63/Smileyface.jpg/112px-Smileyface.jpg

This looks way more blurry than it should. I've purged the cache. Before that the thumbnail was nothing but a single horizontal black line. There was a sharp thumbnail somewhere in the cache (for 140px I think) but that's gone now. May indicate a regression of some sort.


(CC-BY 3.0 Logan Kirst, Created using Adobe Illustrator, 10/3/2011)

Event Timeline

Aklapper renamed this task from Overly blurry thumbnail for specific image to Overly blurry JPG thumbnail for a specific JPG image.Jan 19 2021, 1:16 PM

Testing locally (ImageMagick 7.0.10-58 Q16 x86_64 2021-01-16; libjpeg-turbo 2.0.6-1), this appears to be an issue with chroma subsampling.

$ convert -define tiff:exif-properties=no -define jpeg:size=224x240 -resize 112x120^ -gravity center -extent 112x120 -quality 87 -sampling-factor 4:2:0 -interlace Plane Smileyface.jpg 112px-Smileyface.jpg

$ convert -define tiff:exif-properties=no -define jpeg:size=224x240 -resize 112x120^ -gravity center -extent 112x120 -quality 87 -interlace Plane Smileyface.jpg 112px-Smileyface.jpg 

Our chroma subsampling configuration hasn't changed since at least 2016, and this occurs with the latest ImageMagick. Besides, this is a black-and-white image, so chrominance shouldn't even be a factor.

$ identify -verbose Smileyface.jpg
Image:
  Filename: Smileyface.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 414x444+0+0
  Resolution: 72x72
  Print size: 5.75x6.16667
  Units: PixelsPerInch
  Colorspace: CMYK
  Type: ColorSeparation
  Base type: Undefined
  Endianness: Undefined
  Depth: 8-bit
  Channel depth:
    Cyan: 1-bit
    Magenta: 1-bit
    Yellow: 1-bit
    Black: 8-bit
  Channel statistics:
    Pixels: 183816
    Cyan:
      min: 0  (0)
      max: 0 (0)
      mean: 0 (0)
      median: 0 (0)
      standard deviation: 0 (0)
      kurtosis: -3
      skewness: 0
      entropy: 0
    Magenta:
      min: 0  (0)
      max: 0 (0)
      mean: 0 (0)
      median: 0 (0)
      standard deviation: 0 (0)
      kurtosis: -3
      skewness: 0
      entropy: 0
    Yellow:
      min: 0  (0)
      max: 0 (0)
      mean: 0 (0)
      median: 0 (0)
      standard deviation: 0 (0)
      kurtosis: -3
      skewness: 0
      entropy: 0
    Black:
      min: 0  (0)
      max: 255 (1)
      mean: 44.4774 (0.174421)
      median: 0 (0)
      standard deviation: 93.1603 (0.365335)
      kurtosis: 0.994442
      skewness: 1.70616
      entropy: 0.263009
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 11.1193 (0.0436053)
      median: 0 (0)
      standard deviation: 23.2901 (0.0913337)
      kurtosis: 18.0761
      skewness: 4.453
      entropy: 0.0657523
  Total ink density: 100%
  Colors: 256
  Histogram:
    137584: (0,0,0,0) #00000000 cmyk(0,0,0,0)
    10392: (0,0,0,255) #000000FF cmyk(0,0,0,255)
    9382: (0,0,0,254) #000000FE cmyk(0,0,0,254)
    2004: (0,0,0,1) #00000001 cmyk(0,0,0,1)
    1501: (0,0,0,2) #00000002 cmyk(0,0,0,2)
    1266: (0,0,0,3) #00000003 cmyk(0,0,0,3)
    1159: (0,0,0,253) #000000FD cmyk(0,0,0,253)
    1057: (0,0,0,252) #000000FC cmyk(0,0,0,252)
    1048: (0,0,0,4) #00000004 cmyk(0,0,0,4)
    933: (0,0,0,251) #000000FB cmyk(0,0,0,251)
    856: (0,0,0,5) #00000005 cmyk(0,0,0,5)
    815: (0,0,0,250) #000000FA cmyk(0,0,0,250)
    682: (0,0,0,249) #000000F9 cmyk(0,0,0,249)
    674: (0,0,0,6) #00000006 cmyk(0,0,0,6)
    591: (0,0,0,7) #00000007 cmyk(0,0,0,7)
    564: (0,0,0,248) #000000F8 cmyk(0,0,0,248)
    496: (0,0,0,247) #000000F7 cmyk(0,0,0,247)
    445: (0,0,0,8) #00000008 cmyk(0,0,0,8)
    399: (0,0,0,246) #000000F6 cmyk(0,0,0,246)
    359: (0,0,0,245) #000000F5 cmyk(0,0,0,245)
    350: (0,0,0,9) #00000009 cmyk(0,0,0,9)
    315: (0,0,0,244) #000000F4 cmyk(0,0,0,244)
    298: (0,0,0,10) #0000000A cmyk(0,0,0,10)
    239: (0,0,0,12) #0000000C cmyk(0,0,0,12)
    232: (0,0,0,243) #000000F3 cmyk(0,0,0,243)
    222: (0,0,0,11) #0000000B cmyk(0,0,0,11)
    202: (0,0,0,242) #000000F2 cmyk(0,0,0,242)
    177: (0,0,0,13) #0000000D cmyk(0,0,0,13)
    162: (0,0,0,241) #000000F1 cmyk(0,0,0,241)
    145: (0,0,0,240) #000000F0 cmyk(0,0,0,240)
    139: (0,0,0,14) #0000000E cmyk(0,0,0,14)
    135: (0,0,0,239) #000000EF cmyk(0,0,0,239)
    124: (0,0,0,15) #0000000F cmyk(0,0,0,15)
    121: (0,0,0,238) #000000EE cmyk(0,0,0,238)
    112: (0,0,0,236) #000000EC cmyk(0,0,0,236)
    104: (0,0,0,237) #000000ED cmyk(0,0,0,237)
    102: (0,0,0,128) #00000080 cmyk(0,0,0,128)
    91: (0,0,0,193) #000000C1 cmyk(0,0,0,193)
    84: (0,0,0,235) #000000EB cmyk(0,0,0,235)
    79: (0,0,0,19) #00000013 cmyk(0,0,0,19)
    77: (0,0,0,17) #00000011 cmyk(0,0,0,17)
    76: (0,0,0,229) #000000E5 cmyk(0,0,0,229)
    74: (0,0,0,18) #00000012 cmyk(0,0,0,18)
    74: (0,0,0,16) #00000010 cmyk(0,0,0,16)
    71: (0,0,0,233) #000000E9 cmyk(0,0,0,233)
    70: (0,0,0,234) #000000EA cmyk(0,0,0,234)
    69: (0,0,0,191) #000000BF cmyk(0,0,0,191)
    68: (0,0,0,228) #000000E4 cmyk(0,0,0,228)
    65: (0,0,0,20) #00000014 cmyk(0,0,0,20)
    64: (0,0,0,231) #000000E7 cmyk(0,0,0,231)
    64: (0,0,0,190) #000000BE cmyk(0,0,0,190)
    63: (0,0,0,232) #000000E8 cmyk(0,0,0,232)
    62: (0,0,0,196) #000000C4 cmyk(0,0,0,196)
    60: (0,0,0,195) #000000C3 cmyk(0,0,0,195)
    59: (0,0,0,21) #00000015 cmyk(0,0,0,21)
    57: (0,0,0,189) #000000BD cmyk(0,0,0,189)
    56: (0,0,0,222) #000000DE cmyk(0,0,0,222)
    56: (0,0,0,200) #000000C8 cmyk(0,0,0,200)
    53: (0,0,0,221) #000000DD cmyk(0,0,0,221)
    53: (0,0,0,26) #0000001A cmyk(0,0,0,26)
    53: (0,0,0,185) #000000B9 cmyk(0,0,0,185)
    53: (0,0,0,130) #00000082 cmyk(0,0,0,130)
    52: (0,0,0,219) #000000DB cmyk(0,0,0,219)
    51: (0,0,0,186) #000000BA cmyk(0,0,0,186)
    51: (0,0,0,22) #00000016 cmyk(0,0,0,22)
    51: (0,0,0,24) #00000018 cmyk(0,0,0,24)
    50: (0,0,0,55) #00000037 cmyk(0,0,0,55)
    50: (0,0,0,198) #000000C6 cmyk(0,0,0,198)
    49: (0,0,0,230) #000000E6 cmyk(0,0,0,230)
    49: (0,0,0,226) #000000E2 cmyk(0,0,0,226)
    49: (0,0,0,213) #000000D5 cmyk(0,0,0,213)
    49: (0,0,0,225) #000000E1 cmyk(0,0,0,225)
    49: (0,0,0,201) #000000C9 cmyk(0,0,0,201)
    49: (0,0,0,182) #000000B6 cmyk(0,0,0,182)
    48: (0,0,0,192) #000000C0 cmyk(0,0,0,192)
    48: (0,0,0,223) #000000DF cmyk(0,0,0,223)
    48: (0,0,0,131) #00000083 cmyk(0,0,0,131)
    47: (0,0,0,29) #0000001D cmyk(0,0,0,29)
    47: (0,0,0,132) #00000084 cmyk(0,0,0,132)
    47: (0,0,0,125) #0000007D cmyk(0,0,0,125)
    47: (0,0,0,126) #0000007E cmyk(0,0,0,126)
    46: (0,0,0,204) #000000CC cmyk(0,0,0,204)
    46: (0,0,0,220) #000000DC cmyk(0,0,0,220)
    46: (0,0,0,127) #0000007F cmyk(0,0,0,127)
    45: (0,0,0,227) #000000E3 cmyk(0,0,0,227)
    45: (0,0,0,70) #00000046 cmyk(0,0,0,70)
    45: (0,0,0,28) #0000001C cmyk(0,0,0,28)
    45: (0,0,0,224) #000000E0 cmyk(0,0,0,224)
    45: (0,0,0,194) #000000C2 cmyk(0,0,0,194)
    44: (0,0,0,63) #0000003F cmyk(0,0,0,63)
    44: (0,0,0,23) #00000017 cmyk(0,0,0,23)
    44: (0,0,0,64) #00000040 cmyk(0,0,0,64)
    44: (0,0,0,50) #00000032 cmyk(0,0,0,50)
    44: (0,0,0,187) #000000BB cmyk(0,0,0,187)
    43: (0,0,0,209) #000000D1 cmyk(0,0,0,209)
    43: (0,0,0,27) #0000001B cmyk(0,0,0,27)
    43: (0,0,0,62) #0000003E cmyk(0,0,0,62)
    43: (0,0,0,38) #00000026 cmyk(0,0,0,38)
    43: (0,0,0,215) #000000D7 cmyk(0,0,0,215)
    43: (0,0,0,218) #000000DA cmyk(0,0,0,218)
    42: (0,0,0,179) #000000B3 cmyk(0,0,0,179)
    41: (0,0,0,188) #000000BC cmyk(0,0,0,188)
    41: (0,0,0,40) #00000028 cmyk(0,0,0,40)
    41: (0,0,0,203) #000000CB cmyk(0,0,0,203)
    41: (0,0,0,217) #000000D9 cmyk(0,0,0,217)
    41: (0,0,0,208) #000000D0 cmyk(0,0,0,208)
    41: (0,0,0,184) #000000B8 cmyk(0,0,0,184)
    41: (0,0,0,60) #0000003C cmyk(0,0,0,60)
    40: (0,0,0,140) #0000008C cmyk(0,0,0,140)
    40: (0,0,0,52) #00000034 cmyk(0,0,0,52)
    40: (0,0,0,133) #00000085 cmyk(0,0,0,133)
    40: (0,0,0,77) #0000004D cmyk(0,0,0,77)
    40: (0,0,0,212) #000000D4 cmyk(0,0,0,212)
    40: (0,0,0,202) #000000CA cmyk(0,0,0,202)
    40: (0,0,0,205) #000000CD cmyk(0,0,0,205)
    40: (0,0,0,216) #000000D8 cmyk(0,0,0,216)
    39: (0,0,0,37) #00000025 cmyk(0,0,0,37)
    39: (0,0,0,99) #00000063 cmyk(0,0,0,99)
    39: (0,0,0,124) #0000007C cmyk(0,0,0,124)
    39: (0,0,0,58) #0000003A cmyk(0,0,0,58)
    39: (0,0,0,138) #0000008A cmyk(0,0,0,138)
    38: (0,0,0,123) #0000007B cmyk(0,0,0,123)
    38: (0,0,0,95) #0000005F cmyk(0,0,0,95)
    38: (0,0,0,89) #00000059 cmyk(0,0,0,89)
    38: (0,0,0,36) #00000024 cmyk(0,0,0,36)
    38: (0,0,0,155) #0000009B cmyk(0,0,0,155)
    38: (0,0,0,199) #000000C7 cmyk(0,0,0,199)
    38: (0,0,0,121) #00000079 cmyk(0,0,0,121)
    38: (0,0,0,134) #00000086 cmyk(0,0,0,134)
    38: (0,0,0,53) #00000035 cmyk(0,0,0,53)
    38: (0,0,0,143) #0000008F cmyk(0,0,0,143)
    38: (0,0,0,136) #00000088 cmyk(0,0,0,136)
    38: (0,0,0,207) #000000CF cmyk(0,0,0,207)
    37: (0,0,0,57) #00000039 cmyk(0,0,0,57)
    37: (0,0,0,98) #00000062 cmyk(0,0,0,98)
    37: (0,0,0,178) #000000B2 cmyk(0,0,0,178)
    37: (0,0,0,68) #00000044 cmyk(0,0,0,68)
    37: (0,0,0,32) #00000020 cmyk(0,0,0,32)
    37: (0,0,0,159) #0000009F cmyk(0,0,0,159)
    37: (0,0,0,206) #000000CE cmyk(0,0,0,206)
    37: (0,0,0,48) #00000030 cmyk(0,0,0,48)
    37: (0,0,0,197) #000000C5 cmyk(0,0,0,197)
    36: (0,0,0,65) #00000041 cmyk(0,0,0,65)
    36: (0,0,0,101) #00000065 cmyk(0,0,0,101)
    36: (0,0,0,181) #000000B5 cmyk(0,0,0,181)
    36: (0,0,0,78) #0000004E cmyk(0,0,0,78)
    36: (0,0,0,183) #000000B7 cmyk(0,0,0,183)
    36: (0,0,0,160) #000000A0 cmyk(0,0,0,160)
    36: (0,0,0,92) #0000005C cmyk(0,0,0,92)
    36: (0,0,0,30) #0000001E cmyk(0,0,0,30)
    36: (0,0,0,172) #000000AC cmyk(0,0,0,172)
    35: (0,0,0,161) #000000A1 cmyk(0,0,0,161)
    35: (0,0,0,51) #00000033 cmyk(0,0,0,51)
    35: (0,0,0,54) #00000036 cmyk(0,0,0,54)
    35: (0,0,0,66) #00000042 cmyk(0,0,0,66)
    35: (0,0,0,67) #00000043 cmyk(0,0,0,67)
    35: (0,0,0,88) #00000058 cmyk(0,0,0,88)
    35: (0,0,0,129) #00000081 cmyk(0,0,0,129)
    35: (0,0,0,151) #00000097 cmyk(0,0,0,151)
    35: (0,0,0,169) #000000A9 cmyk(0,0,0,169)
    35: (0,0,0,81) #00000051 cmyk(0,0,0,81)
    34: (0,0,0,152) #00000098 cmyk(0,0,0,152)
    34: (0,0,0,45) #0000002D cmyk(0,0,0,45)
    34: (0,0,0,73) #00000049 cmyk(0,0,0,73)
    34: (0,0,0,137) #00000089 cmyk(0,0,0,137)
    34: (0,0,0,163) #000000A3 cmyk(0,0,0,163)
    33: (0,0,0,25) #00000019 cmyk(0,0,0,25)
    33: (0,0,0,150) #00000096 cmyk(0,0,0,150)
    33: (0,0,0,135) #00000087 cmyk(0,0,0,135)
    33: (0,0,0,147) #00000093 cmyk(0,0,0,147)
    33: (0,0,0,148) #00000094 cmyk(0,0,0,148)
    33: (0,0,0,49) #00000031 cmyk(0,0,0,49)
    33: (0,0,0,214) #000000D6 cmyk(0,0,0,214)
    33: (0,0,0,171) #000000AB cmyk(0,0,0,171)
    33: (0,0,0,119) #00000077 cmyk(0,0,0,119)
    33: (0,0,0,177) #000000B1 cmyk(0,0,0,177)
    33: (0,0,0,210) #000000D2 cmyk(0,0,0,210)
    32: (0,0,0,114) #00000072 cmyk(0,0,0,114)
    32: (0,0,0,34) #00000022 cmyk(0,0,0,34)
    32: (0,0,0,162) #000000A2 cmyk(0,0,0,162)
    32: (0,0,0,166) #000000A6 cmyk(0,0,0,166)
    32: (0,0,0,168) #000000A8 cmyk(0,0,0,168)
    32: (0,0,0,104) #00000068 cmyk(0,0,0,104)
    32: (0,0,0,83) #00000053 cmyk(0,0,0,83)
    32: (0,0,0,144) #00000090 cmyk(0,0,0,144)
    32: (0,0,0,102) #00000066 cmyk(0,0,0,102)
    32: (0,0,0,69) #00000045 cmyk(0,0,0,69)
    32: (0,0,0,173) #000000AD cmyk(0,0,0,173)
    31: (0,0,0,110) #0000006E cmyk(0,0,0,110)
    31: (0,0,0,156) #0000009C cmyk(0,0,0,156)
    31: (0,0,0,145) #00000091 cmyk(0,0,0,145)
    31: (0,0,0,153) #00000099 cmyk(0,0,0,153)
    31: (0,0,0,41) #00000029 cmyk(0,0,0,41)
    31: (0,0,0,103) #00000067 cmyk(0,0,0,103)
    31: (0,0,0,82) #00000052 cmyk(0,0,0,82)
    31: (0,0,0,157) #0000009D cmyk(0,0,0,157)
    31: (0,0,0,84) #00000054 cmyk(0,0,0,84)
    30: (0,0,0,174) #000000AE cmyk(0,0,0,174)
    30: (0,0,0,56) #00000038 cmyk(0,0,0,56)
    30: (0,0,0,43) #0000002B cmyk(0,0,0,43)
    30: (0,0,0,35) #00000023 cmyk(0,0,0,35)
    30: (0,0,0,61) #0000003D cmyk(0,0,0,61)
    29: (0,0,0,74) #0000004A cmyk(0,0,0,74)
    29: (0,0,0,42) #0000002A cmyk(0,0,0,42)
    29: (0,0,0,149) #00000095 cmyk(0,0,0,149)
    29: (0,0,0,47) #0000002F cmyk(0,0,0,47)
    29: (0,0,0,72) #00000048 cmyk(0,0,0,72)
    29: (0,0,0,106) #0000006A cmyk(0,0,0,106)
    29: (0,0,0,33) #00000021 cmyk(0,0,0,33)
    29: (0,0,0,97) #00000061 cmyk(0,0,0,97)
    29: (0,0,0,71) #00000047 cmyk(0,0,0,71)
    29: (0,0,0,112) #00000070 cmyk(0,0,0,112)
    28: (0,0,0,111) #0000006F cmyk(0,0,0,111)
    28: (0,0,0,167) #000000A7 cmyk(0,0,0,167)
    28: (0,0,0,100) #00000064 cmyk(0,0,0,100)
    28: (0,0,0,154) #0000009A cmyk(0,0,0,154)
    28: (0,0,0,142) #0000008E cmyk(0,0,0,142)
    28: (0,0,0,175) #000000AF cmyk(0,0,0,175)
    28: (0,0,0,146) #00000092 cmyk(0,0,0,146)
    28: (0,0,0,141) #0000008D cmyk(0,0,0,141)
    28: (0,0,0,31) #0000001F cmyk(0,0,0,31)
    28: (0,0,0,109) #0000006D cmyk(0,0,0,109)
    27: (0,0,0,120) #00000078 cmyk(0,0,0,120)
    27: (0,0,0,113) #00000071 cmyk(0,0,0,113)
    27: (0,0,0,39) #00000027 cmyk(0,0,0,39)
    26: (0,0,0,180) #000000B4 cmyk(0,0,0,180)
    26: (0,0,0,59) #0000003B cmyk(0,0,0,59)
    26: (0,0,0,91) #0000005B cmyk(0,0,0,91)
    26: (0,0,0,107) #0000006B cmyk(0,0,0,107)
    26: (0,0,0,44) #0000002C cmyk(0,0,0,44)
    26: (0,0,0,108) #0000006C cmyk(0,0,0,108)
    26: (0,0,0,46) #0000002E cmyk(0,0,0,46)
    26: (0,0,0,122) #0000007A cmyk(0,0,0,122)
    26: (0,0,0,158) #0000009E cmyk(0,0,0,158)
    25: (0,0,0,211) #000000D3 cmyk(0,0,0,211)
    25: (0,0,0,117) #00000075 cmyk(0,0,0,117)
    25: (0,0,0,139) #0000008B cmyk(0,0,0,139)
    25: (0,0,0,85) #00000055 cmyk(0,0,0,85)
    25: (0,0,0,118) #00000076 cmyk(0,0,0,118)
    24: (0,0,0,165) #000000A5 cmyk(0,0,0,165)
    24: (0,0,0,115) #00000073 cmyk(0,0,0,115)
    24: (0,0,0,80) #00000050 cmyk(0,0,0,80)
    24: (0,0,0,93) #0000005D cmyk(0,0,0,93)
    24: (0,0,0,75) #0000004B cmyk(0,0,0,75)
    24: (0,0,0,96) #00000060 cmyk(0,0,0,96)
    24: (0,0,0,86) #00000056 cmyk(0,0,0,86)
    23: (0,0,0,79) #0000004F cmyk(0,0,0,79)
    23: (0,0,0,90) #0000005A cmyk(0,0,0,90)
    22: (0,0,0,164) #000000A4 cmyk(0,0,0,164)
    22: (0,0,0,94) #0000005E cmyk(0,0,0,94)
    22: (0,0,0,105) #00000069 cmyk(0,0,0,105)
    21: (0,0,0,170) #000000AA cmyk(0,0,0,170)
    20: (0,0,0,76) #0000004C cmyk(0,0,0,76)
    20: (0,0,0,116) #00000074 cmyk(0,0,0,116)
    18: (0,0,0,176) #000000B0 cmyk(0,0,0,176)
    17: (0,0,0,87) #00000057 cmyk(0,0,0,87)
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 414x444+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 77
  Orientation: Undefined
  Profiles:
    Profile-8bim: 28 bytes
    Profile-icc: 557168 bytes
    Profile-xmp: 23997 bytes
  Properties:
    date:create: 2021-01-19T15:49:25+00:00
    date:modify: 2021-01-19T15:49:25+00:00
    dc:format: image/jpeg
    icc:copyright: Copyright 2000 Adobe Systems, Inc.
    icc:description: U.S. Web Coated (SWOP) v2
    illustrator:StartupProfile: Print
    jpeg:colorspace: 4
    jpeg:sampling-factor: 2x2,1x1,1x1,2x2
    pdf:Producer: Adobe PDF library 9.90
    signature: a31caed4db311503dbe9040d43d6e16efcbc52ef94818f6444ad3455c8fca80b
    xmp:CreateDate: 2011-10-03T16:17:37-05:00
    xmp:CreatorTool: Adobe Illustrator CS5
    xmp:MetadataDate: 2011-10-03T16:17:37-05:00
    xmp:ModifyDate: 2011-10-03T21:17:40Z
    xmpMM:DerivedFrom: proof:pdf
    xmpMM:DocumentID: xmp.did:D4CA992A04EEE01197E7C42F03E4E709
    xmpMM:InstanceID: xmp.iid:D4CA992A04EEE01197E7C42F03E4E709
    xmpMM:OriginalDocumentID: uuid:5D20892493BFDB11914A8590D31508C8
    xmpMM:RenditionClass: proof:pdf
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 608916B
  Number pixels: 183816
  Pixels per second: 43.6773MP
  User time: 0.000u
  Elapsed time: 0:01.004
  Version: ImageMagick 7.0.10-58 Q16 x86_64 2021-01-16 https://imagemagick.org

Turns out this image uses the CMYK colorspace, and chroma-subsampling doesn't work in CMYK. ImageMagick is supposed to ignore it for CMYK images. If the image was transformed to YCCK, then subsampled, that would also be OK. The original file does contain a subsampling-factor property, which seems to be ignored properly when we don't set the CLI param.

I'm not sure if this is more of a "we shouldn't ask ImageMagick to do something stupid" or a "ImageMagick shouldn't do stupid things even if we ask" problem.

Aklapper renamed this task from Overly blurry JPG thumbnail for a specific JPG image to Overly blurry JPG thumbnail for a specific JPG image due to chroma-subsampling not working in CMYK.Jan 22 2021, 12:13 PM

Our chroma subsampling configuration hasn't changed since at least 2016, and this occurs with the latest ImageMagick. Besides, this is a black-and-white image, so chrominance shouldn't even be a factor.

$ identify -verbose Smileyface.jpg
Image:
  Filename: Smileyface.jpg
  ...
  Colorspace: CMYK
  ...

Turns out this image uses the CMYK colorspace, and chroma-subsampling doesn't work in CMYK. ImageMagick is supposed to ignore it for CMYK images. If the image was transformed to YCCK, then subsampled, that would also be OK. The original file does contain a subsampling-factor property, which seems to be ignored properly when we don't set the CLI param.

I'm not sure if this is more of a "we shouldn't ask ImageMagick to do something stupid" or a "ImageMagick shouldn't do stupid things even if we ask" problem.

So you could test for "Colorspace: CMYK" and disable the sampling-factor argument if found?

That is, essentially, how I would fix it on the Thumbor end, if ImageMagick is working as expected. It would make sense to ask them if this is expected behavior first.

That is, essentially, how I would fix it on the Thumbor end, if ImageMagick is working as expected. It would make sense to ask them if this is expected behavior first.

How/where can this be done?

This file uses APP14 marker's ColorTranform set to 0, which means RGB for 3 components and CMYK for 4 components. That is a common problem. This file has ColorTranform 2 which is YCCK. See thumbnail, that is broken. https://en.wikipedia.org/wiki/File:Channel_digital_image_CMYK_color.jpg

ColorTransform 1 is YCbCr.