Pure Java alternative to JAI ImageIO for detecting CMYK images

后端 未结 4 844
忘了有多久
忘了有多久 2020-12-24 15:24

first I\'d like to explain the situation/requirements that lead to the question:

In our web application we can\'t support CMYK images (JPEG) since IE 8 and below can

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-24 15:40

    I've posted a pure Java solution for reading all sorts of JPEG images and converting them to RGB.

    It's built on the following facts:

    • While ImageIO cannot read JPEG images with CMYK as a buffered image, it can read the raw pixel data (raster).
    • Sanselan (or Apache Commons Imaging as it's called now) can be used to read the details of CMYK images.
    • There are images with inverted CMYK values (an old Photoshop bug).
    • There are images with YCCK instead of CMYK (can easily be converted).

提交回复
热议问题