From: <denis.maier@unibe.ch>
To: <ntg-context@ntg.nl>
Subject: [NTG-context] Re: Convert tif to jpg (instead of pdf)
Date: Mon, 24 Jul 2023 10:20:34 +0000 [thread overview]
Message-ID: <ZRAP278MB04951200D51F963BEDD3F3828302A@ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <ZRAP278MB0495BA1A9F5E8B441D94296C833FA@ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM>
[-- Attachment #1.1: Type: text/plain, Size: 1377 bytes --]
Partial success:
I haven't been able to convert the images to jpg proper, but I've been at least been able to enable jpeg compression, thus making the resulting pdfs much smaller:
% enable compression for tiffs
\startluacode
local function compress(oldname, newname, compression)
if not compression or compression == "" then
compression = "jpeg"
end
os.execute(string.format(
'gm convert -compress %s "%s" "%s"',
compression, oldname, newname)
)
end
-- Set the PDF and default TIFF converters to the above function.
figures.converters.tif.pdf = compress
figures.converters.tif.default = compress
\stopluacode
Best,
Denis
Von: denis.maier@unibe.ch <denis.maier@unibe.ch>
Gesendet: Freitag, 21. Juli 2023 13:25
An: ntg-context@ntg.nl
Betreff: [NTG-context] Convert tif to jpg (instead of pdf)
Hi,
According to the documentation, it is possible to automatically convert TIFF images to a format supported by LMTX via GraphicsMagick.
https://wiki.contextgarden.net/Using_Graphics#Image_Conversion
However, by default this produces pdf files which are quite huge. is it possible to instruct grapichsmagick to convert tiff images to jpg instead of to pdf ? There's an example on the linked page in the documentation, but I have to admit that I don't quite understand what I should do...
Best
Denis
[-- Attachment #1.2: Type: text/html, Size: 5429 bytes --]
[-- Attachment #2: Type: text/plain, Size: 495 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
prev parent reply other threads:[~2023-07-24 10:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 11:25 [NTG-context] " denis.maier
2023-07-24 10:20 ` denis.maier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZRAP278MB04951200D51F963BEDD3F3828302A@ZRAP278MB0495.CHEP278.PROD.OUTLOOK.COM \
--to=denis.maier@unibe.ch \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).