Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converting from PDF to PBM inverts the image #1643

Closed
3 tasks done
windmueller opened this issue Jul 20, 2019 · 4 comments
Closed
3 tasks done

Converting from PDF to PBM inverts the image #1643

windmueller opened this issue Jul 20, 2019 · 4 comments

Comments

@windmueller
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of ImageMagick
  • I have searched open and closed issues to ensure it has not already been reported

Description

When using convert to save any PDF file as a PBM file, the result is inverted.
This issue started with 7.0.8.54 and is still present in 7.0.8.55. It might be related to #1632.

Steps to Reproduce

convert file.pdf file.pbm

If this issue does not happen with all PDF files, use this example file.

System Configuration

  • ImageMagick version: 7.0.8.55
  • Environment (Operating system, version and so on): Arch Linux
@fmw42
Copy link

fmw42 commented Jul 20, 2019

From the PBM documentation, the values are intended to be inverted, I believe. So use -negate to invert it in your command line.

Each bit represents a pixel: 1 is black, 0 is white.

See http://netpbm.sourceforge.net/doc/pbm.html

@windmueller
Copy link
Author

I do not think that this behavior is intended since with 7.0.8.53 the image was not inverted.

@urban-warrior
Copy link
Member

Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ https://www.imagemagick.org/download/beta/ by sometime tomorrow.

urban-warrior pushed a commit to ImageMagick/ImageMagick6 that referenced this issue Jul 20, 2019
@fmw42
Copy link

fmw42 commented Jul 20, 2019

I do not think that this behavior is intended since with 7.0.8.53 the image was not inverted.

The inversion is built into PBM according to the documentation. Whether Imagemagick wants to honor or ignore it or not is up to the developers.

But I agree that Imagemagick probably should do the negate internally before writing the PBM output, so a display of the both input and output images looks the same.

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 25, 2019
2019-08-10  7.0.8-60 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-60, GIT revision 16020:52ff205:20190810.

2019-08-07  7.0.8-60 Cristy  <quetzlzacatenango@image...>
  * Enable reading EXR image file from stdin.

2019-08-04  7.0.8-59 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-59, GIT revision 15986:c3de0e7:20190804.

2019-08-01  7.0.8-59 Cristy  <quetzlzacatenango@image...>
  * Module is a reserved keyword for C++ 20 (reference
    ImageMagick/ImageMagick#1650).

2019-07-29  7.0.8-58 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-58, GIT revision 15962:cf00632:20190729.

2019-07-27  7.0.8-58 Cristy  <quetzlzacatenango@image...>
  * Improve GetNextToken() performance.

2019-07-26  7.0.8-57 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-57, GIT revision 15948:8fba4a3:20190726.

2019-07-22  7.0.8-57 Cristy  <quetzlzacatenango@image...>
  * Heap-buffer-overflow in Postscript coder (reference
    ImageMagick/ImageMagick#1644).
  * The -alpha shape option nondeteministic under OpenMP (reference
    https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=36396).
  * Correction to the ModulusAdd and ModulusSubtract composite op (reference
    https://imagemagick.org/discourse-server/viewtopic.php?f=2&t=36413).

2019-07-20  7.0.8-56 Cristy  <quetzlzacatenango@image...>
  * Release ImageMagick version 7.0.8-56, GIT revision 15936:2ac4147:20190720.

2019-07-20  7.0.8-56 Cristy  <quetzlzacatenango@image...>
  * Unexpected -alpha shape results (reference
    https://imagemagick.org/discourse-server/viewtopic.php?f=3&t=36396).
  * Converting from PDF to PBM inverts the image (reference
    ImageMagick/ImageMagick#1643).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants