ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: PNG output
@ 2007-07-12 21:57 w.neimeijer
  0 siblings, 0 replies; 7+ messages in thread
From: w.neimeijer @ 2007-07-12 21:57 UTC (permalink / raw)
  To: ntg-context; +Cc: aa056


> Are you using the current version of gs?
I am using gswin32c 8.53 on Windows

> What does "not so good" mean
I just discovered the \startTEXpage \stopTEXpage to
produce standalone PDF's for all my formulas.
Then I took gswin32c to produce PNG's with
gswin32c -dNOPAUSE -sDEVICE=png256 -sOutputFile=test.png test.pdf

Not so good means that in my first attempts the resolution of these png
images were poor. Than I started using the -r300x300 and things got a bit
better.

Now I am trying to get all these images at a specific width x height
so they show up correctly in my browser.

> If you are still having problems, provide a minimal example (.tex source
No problems, things work, here is an example of my Context source
\starttext
\startTEXpage
\startformula
e^{i x} = \cos x + i \sin x
\stopformula
\stopTEXpage
\stoptext

my Context version is
CtxTools | context version: 2007.04.17 12:51
(C:/Context/isoimage/usr/local/context/tex/texmf-local/tex/context/base/context.tex)
CtxTools | context version: 2007.04.17 12:51
(C:/Context/isoimage/usr/local/context/tex/texmf-local/tex/context/base/cont-new.tex)

Kind regards
Wim

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PNG output
  2007-07-12 19:28 w.neimeijer
                   ` (2 preceding siblings ...)
  2007-07-12 20:23 ` luigi scarso
@ 2007-07-13  3:12 ` Aditya Mahajan
  3 siblings, 0 replies; 7+ messages in thread
From: Aditya Mahajan @ 2007-07-13  3:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 12 Jul 2007, w.neimeijer@hccnet.nl wrote:

> I want to convert my standalone formulas to PNG to display these formulas
> on my website.
>
> What I am doing is the following
>
> \starttext
> \startTEXpage
> \startformula
> e^{i x} = \cos x + i \sin x
> \stopformula
> \stopTEXpage
> \stoptext
>
> and process this via texexec --pdf to get a PDF file.
> I tried to convert the resulting PDF file via gswin32c to png
> but the resulting PNG output is not so good.
>
> Then I read dvipng could do the job, which means I have to produce dvi
> output via texexec --dvi but than I get complaints from dvips that it
> cannot find the file tex.pro for the specials. However a png file is
> produced.

Yes, tex.pro is missing from the context standalone distribution. I 
had just copied the corresponding file from Miktex to the correct 
directory in the standalone distribution.

However, since you only need the dvi, you can use

texexec --dvi --nobackend

HTH,
Aditya
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PNG output
  2007-07-12 20:23 ` zs
@ 2007-07-12 20:47   ` George N. White III
  0 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2007-07-12 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/12/07, zs <stryhal@sci.ujep.cz> wrote:

> Try this:
>
> gs -sDEVICE=png16m -r200 -sOutputFile=formula.png -dBATCH -q -dNOPAUSE
> -dGraphicsAlphaBits=4 -dTextAlphaBits=4\ -dMaxBitmap=50000000
> formula.pdf
>
> You may play with -r parameter.
> You can also make a big picture and downsize it with proper
> interpolation.

These incantations come from ghostscript's "Use.htm" document..  If
you don't need
color, you can try "-sDEVICE=pnggray".  Note that this uses
anti-aliasing, which
looks better on a screen but may cause problems on typical
laserprinters (some may
refuse to print, others will try to render the grays by dithering).

> On Thu, 12 Jul 2007 21:28:32 +0200 (CEST)
> w.neimeijer@hccnet.nl wrote:
>
> > I want to convert my standalone formulas to PNG to display these
> > formulas on my website.
> >
> > What I am doing is the following
> >
> > \starttext
> > \startTEXpage
> > \startformula
> > e^{i x} = \cos x + i \sin x
> > \stopformula
> > \stopTEXpage
> > \stoptext
> >
> > and process this via texexec --pdf to get a PDF file.
> > I tried to convert the resulting PDF file via gswin32c to png
> > but the resulting PNG output is not so good.
> >
> > Then I read dvipng could do the job, which means I have to produce dvi
> > output via texexec --dvi but than I get complaints from dvips that it
> > cannot find the file tex.pro for the specials. However a png file is
> > produced.
> >
> > Help appreciated
> >
> > TIA
> > Wim
> >
> >
> >
> >
> >
> > ___________________________________________________________________________________
> > If your question is of interest to others as well, please add an
> > entry to the Wiki!
> >
> > maillist : ntg-context@ntg.nl /
> > http://www.ntg.nl/mailman/listinfo/ntg-context webpage  :
> > http://www.pragma-ade.nl / http://tex.aanhet.net archive  :
> > https://foundry.supelec.fr/projects/contextrev/ wiki     :
> > http://contextgarden.net
> > ___________________________________________________________________________________
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>


-- 
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PNG output
  2007-07-12 19:28 w.neimeijer
  2007-07-12 20:19 ` George N. White III
  2007-07-12 20:23 ` zs
@ 2007-07-12 20:23 ` luigi scarso
  2007-07-13  3:12 ` Aditya Mahajan
  3 siblings, 0 replies; 7+ messages in thread
From: luigi scarso @ 2007-07-12 20:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Also on gs8.57 device png48 ie
gs  -dNOPAUSE -sDEVICE=png48 -r300x300 -sOutputFile=test.png test.pdf -c quit

48 bit color !


-- 
luigi
----------------------------------------------------------------
If your question is of interest to others as well, please add an entry
to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PNG output
  2007-07-12 19:28 w.neimeijer
  2007-07-12 20:19 ` George N. White III
@ 2007-07-12 20:23 ` zs
  2007-07-12 20:47   ` George N. White III
  2007-07-12 20:23 ` luigi scarso
  2007-07-13  3:12 ` Aditya Mahajan
  3 siblings, 1 reply; 7+ messages in thread
From: zs @ 2007-07-12 20:23 UTC (permalink / raw)
  To: ntg-context

Try this:

gs -sDEVICE=png16m -r200 -sOutputFile=formula.png -dBATCH -q -dNOPAUSE
-dGraphicsAlphaBits=4 -dTextAlphaBits=4\ -dMaxBitmap=50000000
formula.pdf

You may play with -r parameter.
You can also make a big picture and downsize it with proper
interpolation.


ZS


On Thu, 12 Jul 2007 21:28:32 +0200 (CEST)
w.neimeijer@hccnet.nl wrote:

> I want to convert my standalone formulas to PNG to display these
> formulas on my website.
> 
> What I am doing is the following
> 
> \starttext
> \startTEXpage
> \startformula
> e^{i x} = \cos x + i \sin x
> \stopformula
> \stopTEXpage
> \stoptext
> 
> and process this via texexec --pdf to get a PDF file.
> I tried to convert the resulting PDF file via gswin32c to png
> but the resulting PNG output is not so good.
> 
> Then I read dvipng could do the job, which means I have to produce dvi
> output via texexec --dvi but than I get complaints from dvips that it
> cannot find the file tex.pro for the specials. However a png file is
> produced.
> 
> Help appreciated
> 
> TIA
> Wim
> 
> 
> 
> 
> 
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an
> entry to the Wiki!
> 
> maillist : ntg-context@ntg.nl /
> http://www.ntg.nl/mailman/listinfo/ntg-context webpage  :
> http://www.pragma-ade.nl / http://tex.aanhet.net archive  :
> https://foundry.supelec.fr/projects/contextrev/ wiki     :
> http://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: PNG output
  2007-07-12 19:28 w.neimeijer
@ 2007-07-12 20:19 ` George N. White III
  2007-07-12 20:23 ` zs
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: George N. White III @ 2007-07-12 20:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 7/12/07, w.neimeijer@hccnet.nl <w.neimeijer@hccnet.nl> wrote:

> I want to convert my standalone formulas to PNG to display these formulas
> on my website.
>
> What I am doing is the following
>
> \starttext
> \startTEXpage
> \startformula
> e^{i x} = \cos x + i \sin x
> \stopformula
> \stopTEXpage
> \stoptext
>
> and process this via texexec --pdf to get a PDF file.
> I tried to convert the resulting PDF file via gswin32c to png
> but the resulting PNG output is not so good.

Are you using the current version of gs?  There have been changes
to the font rendering over the years, so you want to try a current
version.

A quick way to get a second opinion is to install the emacs+auctex
bundle for Win32 to see how you like the preview images.

What does "not so good" mean -- there are lots of parameters to
adjust anti-aliasing, color models, and resolution with gs, but I'm not sure
about things like gamma.  ImageMagick's convert may provide an
easier interface.  If you are using pk fonts you may encounter problems
if the fonts resolution isn't "compatible" with the output resolution.

> Then I read dvipng could do the job, which means I have to produce dvi
> output via texexec --dvi but than I get complaints from dvips that it
> cannot find the file tex.pro for the specials. However a png file is
> produced.
>
> Help appreciated

In the long run, using pdf  has the advantage that the tools are supported
by a much wider community than the small set of people who have heard of
.dvi format.  The number of people who would be affected by a problem in
gs rendering is orders of magnitude larger than the number who would
notice a problem with dvipng.  The latter group can always switch to pdf and
gs, while the former group doesn't have viable alternatives.   As a  result,
assuming the problem is not related to TeX-specific font formats, it is very
likely that gs can do what you need today and that future version on future
platforms will also "work".

If you are still having problems, provide a minimal example (.tex
source and .png
image) along with the software versions so others can try to reproduce
the problem.

-- 
George N. White III <aa056@chebucto.ns.ca>
Head of St. Margarets Bay, Nova Scotia
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

* PNG output
@ 2007-07-12 19:28 w.neimeijer
  2007-07-12 20:19 ` George N. White III
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: w.neimeijer @ 2007-07-12 19:28 UTC (permalink / raw)
  To: ntg-context

I want to convert my standalone formulas to PNG to display these formulas
on my website.

What I am doing is the following

\starttext
\startTEXpage
\startformula
e^{i x} = \cos x + i \sin x
\stopformula
\stopTEXpage
\stoptext

and process this via texexec --pdf to get a PDF file.
I tried to convert the resulting PDF file via gswin32c to png
but the resulting PNG output is not so good.

Then I read dvipng could do the job, which means I have to produce dvi
output via texexec --dvi but than I get complaints from dvips that it
cannot find the file tex.pro for the specials. However a png file is
produced.

Help appreciated

TIA
Wim





___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-13  3:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-12 21:57 PNG output w.neimeijer
  -- strict thread matches above, loose matches on Subject: below --
2007-07-12 19:28 w.neimeijer
2007-07-12 20:19 ` George N. White III
2007-07-12 20:23 ` zs
2007-07-12 20:47   ` George N. White III
2007-07-12 20:23 ` luigi scarso
2007-07-13  3:12 ` Aditya Mahajan

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).