Scaling down the resolution of used pictures
At the moment it is not very important, but my other question remembered me about an old situation. I do not use graphics a lot in my ConTeXt files. But some time ago I used several pictures with a very high resolution. This made the resulting PDF very big. I did not expect the PDF printed on a printer with a higher resolution as 1200 DPI. Is there a way to have the included graphics not be bigger as necessary (without changing the original pictures)? Again, at the moment it is not urgent. But when I come in the same situation again, it would be nice if the resulting PDF was not five times as big as necessary. And maybe the answer is useful for someone else also. ;-} -- Cecil Westerhof
2011/6/29 Cecil Westerhof
I do not use graphics a lot in my ConTeXt files. But some time ago I used several pictures with a very high resolution. This made the resulting PDF very big. I did not expect the PDF printed on a printer with a higher resolution as 1200 DPI. Is there a way to have the included graphics not be bigger as necessary (without changing the original pictures)?
Use a program for image manipulation, e.g. ImageMagick. Best Martin
2011/6/29 Martin Schröder
I do not use graphics a lot in my ConTeXt files. But some time ago I used several pictures with a very high resolution. This made the resulting PDF very big. I did not expect the PDF printed on a printer with a higher resolution as 1200 DPI. Is there a way to have the included graphics not be bigger as necessary (without changing the original pictures)?
Use a program for image manipulation, e.g. ImageMagick.
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. Saves a lot of time. Also: when changing from A4 to A5, you have to do it all over again. -- Cecil Westerhof
Am 2011-06-29 um 17:01 schrieb Cecil Westerhof:
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. Saves a lot of time.
There once was t-degrade module: http://modules.contextgarden.net/t-degrade I guess the modern way would be using t-filter: http://modules.contextgarden.net/filter Greetlings from Lake Constance! Hraban --- http://www.fiee.net/texnique/ http://wiki.contextgarden.net https://www.cacert.org (I'm an assurer)
On Wed, Jun 29, 2011 at 5:01 PM, Cecil Westerhof
2011/6/29 Martin Schröder
I do not use graphics a lot in my ConTeXt files. But some time ago I used several pictures with a very high resolution. This made the resulting PDF very big. I did not expect the PDF printed on a printer with a higher resolution as 1200 DPI. Is there a way to have the included graphics not be bigger as necessary (without changing the original pictures)?
Use a program for image manipulation, e.g. ImageMagick.
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. still not without an external program, but I hope for Porquerolles.
-- luigi
On 29-6-2011 5:01, Cecil Westerhof wrote:
2011/6/29 Martin Schröder
I do not use graphics a lot in my ConTeXt files. But some time ago I used several pictures with a very high resolution. This made the resulting PDF very big. I did not expect the PDF printed on a printer with a higher resolution as 1200 DPI. Is there a way to have the included graphics not be bigger as necessary (without changing the original pictures)?
Use a program for image manipulation, e.g. ImageMagick.
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. Saves a lot of time. Also: when changing from A4 to A5, you have to do it all over again.
You can plugin in a converter. However, it only works for one to anothe format so you need to patch a line in grph-inc.lua: line 416: local converter = (newformat ~= format or resolution) and converters[format] (I'll figure out something better for this so it's a temp hack.) Such a plugin looks like: \startluacode figures.converters.png = { png = function(oldname,newname,resolution) local command = string.format('gm convert -depth 1 "%s" "%s"',oldname,newname) logs.report(string.format("running command %s",command)) os.execute(command) end } \stopluacode \externalfigure[mill.png][resolution=lowres,conversion=png] Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, 29 Jun 2011, Hans Hagen wrote:
Such a plugin looks like:
\startluacode figures.converters.png = { png = function(oldname,newname,resolution) local command = string.format('gm convert -depth 1 "%s" "%s"',oldname,newname) logs.report(string.format("running command %s",command)) os.execute(command) end } \stopluacode
Don't you need to use 'resolution' somewhere in the function?
\externalfigure[mill.png][resolution=lowres,conversion=png]
Aditya
On 29-6-2011 7:20, Aditya Mahajan wrote:
On Wed, 29 Jun 2011, Hans Hagen wrote:
Such a plugin looks like:
\startluacode figures.converters.png = { png = function(oldname,newname,resolution) local command = string.format('gm convert -depth 1 "%s" "%s"',oldname,newname) logs.report(string.format("running command %s",command)) os.execute(command) end } \stopluacode
Don't you need to use 'resolution' somewhere in the function?
Well, not 'need' but it would make sense of course to use that info, for instance to set the depth or resolution but I wasn't in the mood for studying the man pages (and I always forget the command line arguments), so I leave that 'as an exercise for the reader'. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On Wed, Jun 29 2011, Hans Hagen wrote:
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. Saves a lot of time. Also: when changing from A4 to A5, you have to do it all over again.
You can plugin in a converter. However, it only works for one to anothe format so you need to patch a line in grph-inc.lua:
Could img.copy() help here perhaps? -- Peter
On 29-6-2011 9:43, Peter Münster wrote:
On Wed, Jun 29 2011, Hans Hagen wrote:
That would be a possibility, but I was wondering if there was a way to let ConTeXt do it. Saves a lot of time. Also: when changing from A4 to A5, you have to do it all over again.
You can plugin in a converter. However, it only works for one to anothe format so you need to patch a line in grph-inc.lua:
Could img.copy() help here perhaps?
that's unrelated, Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (7)
-
Aditya Mahajan
-
Cecil Westerhof
-
Hans Hagen
-
Henning Hraban Ramm
-
luigi scarso
-
Martin Schröder
-
pmlists@free.fr