Just going to add a bit to andrea's response. jpeg is a compression format based on how the human eye works; the eye is very good at seeing a color on one side of a "sky" and another color on the other side of the sky and filling in a nice smooth gradient in your mind. Even when the actual data shown on the monitor does not actually have a smooth gradient.
The jpeg standard uses other silly human tricks about how the eye works in order to throw out information that is not needed because your mind will fill in the gaps giving you the same experience. To do this it needs the *entire* image; and it also needs the entire image show to your eye. So it is really not very suitable for GIS use where we expect the image to reflect measurements. Formats like geotiff and ecw are organised to be read off disk; so depending on where in the image you are they can calculate what area of the file to read; and thus display part of the image without having to read the whole thing. Even when zoomed out; because the file structure is organised the readers can sample the pixels to pull out just enough information for what is on screen and no more. For GeoTiff they can even go beyond this and have an overlay of the file which we can display when JMapPane is zoomed out, or internally structure the file with "tiles" for even better performance (less disk seeking) when zoomed in. So why would you ever use jpeg? Well if your application is slow due to network use; perhaps you can make the individual files smaller so they spend less time going down the wire. There is some good background information for you here from the making maps fast workshop: - http://download.osgeo.org/osgeo/foss4g/2009/SPREP/0Tue/Parkside%20GO2/0900/ Jody On Wed, Jul 28, 2010 at 2:11 AM, S Dille <[email protected]> wrote: > > Hi, > I have a question about rendering images. What would cause a 8 MB jpg > file to take about 20 minutes to render, while a 5 MB TIF file renders in > about 1 second? I am simply opening these in a JMapPane, while using a > StreamingRenderer and I'm kind of lost on how to increase rendering > performance for images. Both files are georeferenced with projection and > world files. Below is my code for inserting the images: > > AbstractGridFormat format = GridFormatFinder.findFormat(imageFile); > readImage = format.getReader(imageFile); //readImage is an > AbstractGridCoverage2DReader object > > GridCoverage2D covLayer = null; > try { > covLayer = (GridCoverage2D) readImage.read(null); > } catch (Exception e) { > e.printStackTrace(); > } > > mapContext.addLayer(covLayer,Style); > > > I know this is a pretty general question, but are there any image or JAI > experts that can point me in the right direction on how I can find out why > some files take so long to render, while other similarly sized images load > quickly? > > Any help would be much appreciated > > Thanks! > > S Dille > -- > View this message in context: > http://osgeo-org.1803224.n2.nabble.com/StreamingRenderer-and-large-images-tp5342830p5342830.html > Sent from the geotools-gt2-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > The Palm PDK Hot Apps Program offers developers who use the > Plug-In Development Kit to bring their C/C++ apps to Palm for a share > of $1 Million in cash or HP Products. Visit us here for more details: > http://ad.doubleclick.net/clk;226879339;13503038;l? > http://clk.atdmt.com/CRS/go/247765532/direct/01/ > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
