hoehrmann / CutyCapt

A Qt WebKit Web Page Rendering Capture Utility
http://cutycapt.sourceforge.net/
99 stars 49 forks source link

Set proper RenderHints for better Image Scaling #2

Closed g1plus closed 11 years ago

g1plus commented 11 years ago

Scaled images (especially upscaled) are poorly interpolated (nearest neighbor?). CutyCapt should set (or allow through flags to set) renderhints to circumvent this.

Simple hack:

painter.begin(&image);
painter.setRenderHint(QPainter::SmoothPixmapTransform);
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::TextAntialiasing);
painter.setRenderHint(QPainter::HighQualityAntialiasing);
mainFrame->render(&painter);
hoehrmann commented 11 years ago

I have tried this a couple of times on Windows, most recently with the current version of Qt 5.x for that system, and it had no effect that I could discern. Have you tried this, and on what kind of system?

g1plus commented 11 years ago

I tried it under linux (Arch Linux x64, qt5) because I ran into this problem when using the CSS-property background-size: cover You can try: CutyCapt --url=http://webstandard.kulando.de/static/backgroundsize-css-tutorial --out=jagged.png --min-width=1920

I attached two images, with and without RenderHints

not_smooth smooth

uppalasx commented 10 years ago

hoehrmann, how we can create CutyCapt.exe file in windows machine?