Page 1 of 1

How to change image resolution

Posted: 2008-09-04T11:11:46-07:00
by Kuzma
I have some Magick++ API.

Code: Select all

    vector<Blob> vector_blob;
    Blob temp_blob;
    vector<size_t> data_size;
    size_t temp_data_size;
    vector<char *>dib;
    char * temp_dib;
    int number_of_page;
    Image image;
    try {
	vector<Image> imageVector;
	cout << "Create imageVector\n";
	readImages( &imageVector, fname);
	cout << "read image to imageVector\n";
...
    image.write( "x.bmp" );
fname is pdf file. I write first page of it on Image image. I get image file with default density 72dpi. I want a resolution 300. How to set a resolution of each Image in imageVector to 300?
Please help me.

Re: How to change image resolution

Posted: 2008-09-04T11:23:09-07:00
by magick
Have you tried the density() or the STL densityImage() methods?

Re: How to change image resolution

Posted: 2008-09-04T20:34:52-07:00
by Kuzma
Yes, I try.
I write

Code: Select all

...
readImages( &imageVector, fname);
for_each(imageVector.begin(),imageVector.end(),densityImage("300x300") );
...
with no results.

Re: How to change image resolution

Posted: 2008-09-04T20:44:02-07:00
by magick
What image format are you writing? Some program only recognize the image resolution if its embedded in an EXIF profile.

Re: How to change image resolution

Posted: 2008-09-04T21:00:53-07:00
by Kuzma
I write to Blob object.
But I think the problem that there are not member function like set_default_density(...) or/ and set_default_resolution(...).
I reading pdf from file (and have set up default density to 72) and after reading to vector<Image> I try change resolution, but pdf is already converted with default resolution.
Is it my utterance correct?

Re: How to change image resolution

Posted: 2008-09-06T09:46:12-07:00
by Kuzma
Please help me/give me example