MikeWey / DMagick

An ImageMagick binding for the D Programming Language.
zlib License
17 stars 4 forks source link

set image quality does not work #17

Closed donglei closed 8 years ago

donglei commented 8 years ago

auto originalIMage = new Image(blob); ..... originalIMage.resize(........); originalIMage.quality(65); originalIMage.toBlob();

but image quality does not work? how can i do that?

MikeWey commented 8 years ago

The following is working for me, do you have a more complete example that's not working?

Image example = new Image(Geometry(100, 100), new Color("green"));
example.quality = 60;
void[] blob = example.toBlob("jpg");

Image test = new Image(blob);
assert(test.quality == 60);
donglei commented 8 years ago

import std.stdio;
void main()
{
    import dmagick.Image;
    auto img = new Image("./007c6581e43b86f1676ed5762ddac3362d460605.jpeg");
    img.quality(10);
    img.write("./test.png");

}

the test.png does not smaller than 007c6581e43b86f1676ed5762ddac3362d460605.jpeg. it just has property with quality = 10, but looks like the original, without the effect of the fuzzy

donglei commented 8 years ago

maybe it cased by png formate