ABOUT US

|

SUPPORT

|

BLOG

DOWNLOADS    

 

 

 

 


 

 

Thumbnail and scaled image generation

 

 

 

 

 

 

Rendering Thumbnails

WebRenderer Server Edition can generate high-quality thumbnails of rendered web pages. When creating thumbnails, the page is first rendered full-size to an internal buffer and then scaled to the required thumbnail dimensions. This process allows maximum clarity to be achieved in the thumbnail by using a pixel-resampling technique that produces superior quality at very low resolutions.

To create a thumbnail, use the following IBrowserCanvas function/s...

BufferedImage saveToBufferedImageScaled(double scalefactor)

// OR

savePageImageToDiskScaled(File fileName, int imageFormat)

The scalefactor is multiplied by the original rendered page size to give a thumbnail size. Thumbnail scaling may be up or down (a scalefactor > 1 will magnify the original). Since the WebRenderer Server Edition does not rely upon a screen for rendering, the rendered page dimensions will vary based upon the page content. Consequently, thumbnails generated may vary in dimensions from each other (but aspect ratio is preserved for any thumbnail). To generate thumbnails of constant size, see (below).

 

 

 


 www.webrenderer.com at 37.5% scaling.


 at 20%


 at 5%

 

 

 

 

 

 

Thumbnails are generated by scaling the original rendered page in both dimensions equally. As WebRenderer Server Edition is working with a virtual screen of arbitrary dimensions, the thumbnails reflect the proportions of the original rendered page (as opposed to the proportions of the screen/window used for display in a typical browser). A sample Google results page is shown at right. Note that the thumbnail maintains the aspect ratio of the original full-size page.

WebRenderer Server Edition is useful for producing full-length 'screen shots' for Web documentation, as shown in these examples.


Scaled Thumbnails

WebRenderer Server Edition can generate thumbnails of an arbitrary set size. There are two ways to fit a rendered page into a presized thumbnail; clipping and scaling. Both are handled by the function/s... 

BufferedImage saveToBufferedImageScaled(int width, int height, boolean scaleheight)

// OR

savePageImageToDiskScaled(java.io.File fileName, int imageFormat, int width, int height, boolean scaleHeight)  

Set scaleheight to false for clipped thumbnails, and to true for scaled thumbnails. Clipped thumbnails render the page to the full width of the thumbnail, trimming the bottom of the page as required to fit into the available thumbnail height. Scaled thumbnails adjust the scaling on the entire page such that at least one of the dimensions occupies the full size of the thumbnail, and the entire page fits within the thumbnail area. The remainder of the thumbnail (that is, the area not occupied by rendered page data) is set to transparent.

 


These examples show a www.google.com search rendered as 240 x 180 pixel scaled thumbnails. The image at left shows scaling to the width of the thumbnail with clipping at the bottom. The image at right shows a scaled thumbnail where the entire rendered page is visible. Note that the grey area in the image at right appears as transparent in the original, and is visible here for demonstration purposes only.

 

 

 

 

 

 

 Copyright © JadeLiquid Software - www.jadeliquid.com