{"record":{"id":"a3e0b34f55a730dc","repo":"ocrmypdf/OCRmyPDF","slug":"input-cmyk-image-has-no-icc-profile-not-usable","errorCode":null,"errorMessage":"Input CMYK image has no ICC profile, not usable","messagePattern":"Input CMYK image has no ICC profile, not usable","errorType":"error_code","errorClass":"UnsupportedImageFormatError","httpStatus":null,"severity":"error","filePath":"src/ocrmypdf/_pipeline.py","lineNumber":132,"sourceCode":"                )\n        elif not options.image_dpi:\n            log.info(\"Image size: (%d, %d)\", *im.size)\n            raise DpiError(\n                \"Input file is an image, but has no resolution (DPI) \"\n                \"in its metadata.  Estimate the resolution at which \"\n                \"image was scanned and specify it using --image-dpi.\"\n            )\n\n        if im.mode in ('RGBA', 'LA'):\n            raise UnsupportedImageFormatError(\n                \"The input image has an alpha channel. Remove the alpha channel first.\"\n            )\n\n        if 'iccprofile' not in im.info:\n            if im.mode == 'RGB':\n                log.info(\"Input image has no ICC profile, assuming sRGB\")\n            elif im.mode == 'CMYK':\n                raise UnsupportedImageFormatError(\n                    \"Input CMYK image has no ICC profile, not usable\"\n                )\n\n    try:\n        log.info(\"Image seems valid. Try converting to PDF...\")\n        layout_fun = img2pdf.default_layout_fun\n        if options.image_dpi:\n            layout_fun = img2pdf.get_fixed_dpi_layout_fun(\n                Resolution(options.image_dpi, options.image_dpi)\n            )\n        with output_file.open('wb') as outf:\n            img2pdf.convert(\n                os.fspath(input_file),\n                layout_fun=layout_fun,\n                outputstream=outf,\n                **IMG2PDF_KWARGS,\n            )\n        log.info(\"Successfully converted to PDF, processing...\")","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/_pipeline.py#L114-L150","documentation":"Raised when a CMYK input image lacks an ICC profile. Color conversion from CMYK to RGB cannot be done meaningfully without a color profile, so the file is rejected as unusable.","triggerScenarios":"Input image with im.mode == 'CMYK' and no 'iccprofile' key in im.info; checked in triage_image_file.","commonSituations":"Print-ready CMYK JPEGs/TIFFs from prepress workflows where the profile was stripped.","solutions":["Convert the image to RGB with a color-managed tool (Photoshop, ImageMagick with a CMYK profile) and retry","Embed an appropriate CMYK ICC profile into the image before running ocrmypdf"],"exampleFix":"# before\nocrmypdf press.jpg out.pdf\n# after (ImageMagick)\nmagick press.jpg -profile USWebCoatedSWOP.icc -profile sRGB.icc press_rgb.jpg\nocrmypdf press_rgb.jpg out.pdf","handlingStrategy":"validation","validationCode":"from PIL import Image\nwith Image.open(src) as im:\n    if im.mode == 'CMYK' and 'iccprofile' not in im.info:\n        im = im.convert('RGB')  # or require profile\n        im.save(src)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Convert CMYK assets to RGB during intake for OCR workflows"],"tags":["ocr","ocrmypdf","color-management","cmyk","icc-profile"],"backgroundTag":"missing-color-profile","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}