Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

how to edit image's property? such as: quality, width, height #22

Open
yellowChao opened this issue Jun 16, 2016 · 7 comments
Open

how to edit image's property? such as: quality, width, height #22

yellowChao opened this issue Jun 16, 2016 · 7 comments

Comments

@yellowChao
Copy link

No description provided.

@alexcroox
Copy link

50ee409

@alexcroox
Copy link

The quality flag doesn't seem to do much for me, the image contained in my test PDF is of very high quality but it comes out heavily pixilated even at medium sizes using the linked options.

@haydenbleasel
Copy link

We should be using the -size tag to specify an input size but it's ignoring it.

@codecounselor
Copy link

codecounselor commented Oct 14, 2016

Many ImageMagick options must come after the filename, see this example http://stackoverflow.com/a/6605085
But the code currently lists them all before the source file.
(These are known as Image Operators )

Update: It seems that this is actually working despite the ordering

@zjr
Copy link

zjr commented Oct 27, 2017

The PDFImage 'class' takes a second options parameter. You can use it like this:

const pdfImageOpts = {
  outputDirectory: path.join(__dirname, './wmReports/images'),
  convertExtension: 'jpg',
  convertOptions: {
    '-colorspace': 'RGB',
    '-interlace': 'none',
    '-density': '300',
    '-quality': '100'
  }
};

const pdfImage = new PDFImage(file, pdfImageOpts);

pdfImage.convertPage… // etc. etc..

@tchantzakos
Copy link

The quality flag doesn't seem to do much for me, the image contained in my test PDF is of very high quality but it comes out heavily pixilated even at medium sizes using the linked options.

almost 3 years later but did you find any solution to avoid the pixilized output image?

@blqke
Copy link

blqke commented Sep 18, 2019

The quality flag doesn't seem to do much for me, the image contained in my test PDF is of very high quality but it comes out heavily pixilated even at medium sizes using the linked options.

almost 3 years later but did you find any solution to avoid the pixilized output image?

Had the same problem, the -density parameter resolved my case

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants