Hi Hraban,
Am 01.09.22 um 10:56 schrieb Henning Hraban Ramm via ntg-context:
\startluacode
local function downsampler(oldname, newname, resolution)
if not resolution or resolution == "" then
resolution = 72
end
local cmd = string.format(
[[gm convert -resample %ix%i %s %s]],
resolution, resolution, oldname, newname)
os.execute(cmd)
end
-- Set the PDF and default JPEG converters to the above function.
figures.converters.jpg.pdf = downsampler
figures.converters.jpg.default = downsampler
\stopluacode
I didn’t manage to plug this into the "conversion" mechanism.
Thanks a lot. With this I get 5.9MB instead of 13MB.
Maybe I can skip postprocessing the pdf file with ps2pdf.
From an error message I guess that this script also tries to downsample
png files. Is that correct?
juh
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage : https://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___________________________________________________________________________________