{"record":{"id":"14b06780bfd3539b","repo":"ocrmypdf/OCRmyPDF","slug":"jbig2-lossy-is-deprecated-and-will-be-ignored-los","errorCode":null,"errorMessage":"jbig2_lossy is deprecated and will be ignored. Lossy JBIG2 has been removed due to character substitution risks.","messagePattern":"jbig2_lossy is deprecated and will be ignored\\. Lossy JBIG2 has been removed due to character substitution risks\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/ocrmypdf/api.py","lineNumber":837,"sourceCode":"                'input_file',\n                'output_file',\n                'kwargs',\n                'plugin_manager',\n            }\n        }\n        create_options_kwargs.update(kwargs)\n\n        parser = get_parser()\n        with _plugin_session(plugins, plugin_manager, parser=parser) as plugin_manager:\n            if 'verbose' in kwargs:\n                warn(\n                    \"ocrmypdf.ocr(verbose=) is ignored. \"\n                    \"Use ocrmypdf.configure_logging().\"\n                )\n\n            # Warn about deprecated jbig2 options and remove from kwargs\n            if jbig2_lossy:\n                warn(\n                    \"jbig2_lossy is deprecated and will be ignored. \"\n                    \"Lossy JBIG2 has been removed due to character substitution risks.\"\n                )\n                create_options_kwargs.pop('jbig2_lossy', None)\n            if jbig2_page_group_size:\n                warn(\"jbig2_page_group_size is deprecated and will be ignored.\")\n                create_options_kwargs.pop('jbig2_page_group_size', None)\n\n            options = create_options(\n                input_file=input_file,\n                output_file=output_file,\n                parser=parser,\n                **create_options_kwargs,\n            )\n            check_options(options, plugin_manager)\n            return run_pipeline(options=options, plugin_manager=plugin_manager)\n\n","sourceCodeStart":819,"sourceCodeEnd":855,"githubUrl":"https://github.com/ocrmypdf/OCRmyPDF/blob/5074a0b0e109362422b768fd271ed84bf717c4ec/src/ocrmypdf/api.py#L819-L855","documentation":"Lossy JBIG2 encoding was removed from OCRmyPDF due to character substitution risks (lossy JBIG2 can swap visually similar characters). Passing jbig2_lossy=True now only triggers this warning; the option is discarded.","triggerScenarios":"Calling ocrmypdf.ocr(..., jbig2_lossy=True); the argument is popped from create_options_kwargs after warning.","commonSituations":"Scripts written for older OCRmyPDF versions that supported lossy JBIG2 compression; users chasing smaller file sizes for scanned documents.","solutions":["Remove jbig2_lossy from your call — it does nothing now","Use standard (lossless) JBIG2 if the encoder is available, or accept higher file size","If size matters, tune jpeg_quality instead for image-only pages"],"exampleFix":"# before\nocrmypdf.ocr('in.pdf', 'out.pdf', jbig2_lossy=True)\n# after\nocrmypdf.ocr('in.pdf', 'out.pdf')  # lossy JBIG2 removed for correctness","handlingStrategy":"validation","validationCode":"kwargs.pop('jbig2_lossy', None)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove removed options from shared config dicts after upgrades","Use lossless compression settings only"],"tags":["deprecation","jbig2","compression","removed-feature"],"backgroundTag":"deprecated-keyword-argument","analyzedSha":"5074a0b0e109362422b768fd271ed84bf717c4ec","analyzedAt":"2026-08-27T11:57:38.523Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}