Message Boards Message Boards

[?] Control image resolution with HTML Export?

Posted 7 years ago

I'm using the Grid function to create a formatted table (which includes hyperlinks)

report = Grid[...]

and I'm exporting it using

Export[NotebookDirectory[],report,"HTML"]

but I can't get the image resolution to be higher than some built-in default. I've tried:

Export[NotebookDirectory[],report,"HTML", ImageResolution->nnn]

and

Export[NotebookDirectory[],report,"HTML", RasterSize->nnn]

but nothing seems to affect the actual image size (it shows up blurry when I upload it to my website). Is there some other option I'm supposed to be using?

POSTED BY: Andrew

Are they Images or Graphics? The difference is important.

Here's a simple example of your problem with a 100 by 100 image and a 200 by 200 image:

Export["test1.html", Grid[{{RandomImage[1, {100, 100}]}}], "HTML"]

Export["test2.html", Grid[{{RandomImage[1, {200, 200}]}}], "HTML"]

When I export these and import them again, I get back Images of the correct size.

You are probably using Graphics instead of Images. Most plotting functions produce Graphics. You can turn Graphics into Images using Rasterize:

Image@Rasterize[myGraphics, RasterSize -> {100, 100}]

I would try using this on my plotting functions.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract