[Gambas-user] Trying to improve the image quality output

Martin Belmonte mbelmonte at belmotek.net
Wed Mar 9 12:08:09 CET 2022


Hi,
I use a gambas code [1] to made images imposition [4] in order to print 
two pages in one sheet and save paper. The final image quality is lower 
that original so:

1) Is possible improve the final quality in the gambas code [1] ?
2) There are some code to use Imagemagick with Extern in gambas, focused
in the Montage function [2]? I use [3] in terminal that offer a better 
image quality that gambas Cairo.Paint.

Please see the screenshot in imgur.com, where is possible see the 
diferences between original image and gambas otput image
https://imgur.com/7frYu2F

[1]

  hCanvas = New CairoPdfSurface("/tmp/job.pdf, 420.0, 297.0)
  Cairo.Begin(hCanvas)

  h = 297 * 2.85
  w = h * (1 / Sqr(2))
  hImageL = Image.Load("/tmp/001.tif").Stretch(w, h)
  hImageR = Image.Load("/tmp/002.tif"]).Stretch(w, h)

  Cairo.Source = Cairo.ImagePattern(hImageL, 0, 0,, Cairo.FilterBest)
  Cairo.Paint
  Cairo.Source = Cairo.ImagePattern(hImageR, w, 0,, Cairo.FilterBest)
  Cairo.Paint
  Cairo.ShowPage()


[2]
https://imagemagick.org/script/montage.php
[3]
magick montage -geometry +4+4 001.tif 002.tif montage.jpeg

[4]
https://en.wikipedia.org/wiki/Imposition

-----

Regards
Martín.


More information about the User mailing list