Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • bob.io.image bob.io.image
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 2
    • Issues 2
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • bobbob
  • bob.io.imagebob.io.image
  • Issues
  • #19
Closed
Open
Issue created Sep 09, 2016 by Manuel Günther@mguentherMaintainer

Cannot read CMYK jpeg images

Currently, we support only images in either gray or RGB color space. However, there are some JPEG images stored in different color spaces, such as CMYK or YCCK: https://www.freedesktop.org/wiki/Software/libjpeg Currently these images cannot be read with bob.io.image.load, we get the following exception:

RuntimeError: File - CMYK.jpg: C++ exception caught: 'unsupported number of planes (4) when reading file. Image depth must be 1 or 3.'

Unfortunately, libjpeg does not provide a default color conversion to convert CMYK images into RGB (only YCCK <==> CMYK conversions are supported). Hence, in order to be able to read these types of images, we need to perform our own color conversion, i.e., here: https://gitlab.idiap.ch/bob/bob.io.image/blob/master/bob/io/image/cpp/jpeg.cpp#L152

Ideally, we would have a link to bob.ip.color and implement the color conversion function (see e.g. here: http://www.rapidtables.com/convert/color/cmyk-to-rgb.htm) cmyk_to_rgb and/or rgb_to_cmyk in there. However, this would create a new dependency between packages, i.e., from bob.io.image to bob.ip.color. In fact, this might be a good idea anyways, i.e., in order to be able to get a color color image from any kind of image source (by automatically converting color types, if necessary).

Assignee
Assign to
Time tracking