raster

What's a good way to store raster data?

I have a variety of time-series data stored on a more-or-less georeferenced grid, e.g. one value per 0.2 degrees of latitude and longitude. Currently the data are stored in text files, so at day-of-year 251 you might see: 251 12.76 12.55 12.55 12.34 [etc., 200 more values...] 13.02 12.95 12.70 12.40 [etc., 200 more values...] [etc., ...

Convert Bitmap to Polygon - (Reverse-Rasterizing)

Given a bitmap image with some blots of solid color on it, what algorithm would you employ to construct polygons in the same shape as the blots? This can be done in multiple steps: a high-resolution polygon could be later cut down by a best fit algorithm. Bonus points if you can tell me how to cut the resulting polygons into convex com...

polygon to raster GIS

I have a shapefile of India with states (probably as polygons). I want to convert each polygon into equally divided cells ("raster" way), and populate (actually coloring) each cell by a value that would be calculated from an algorithm which is cell's location specific. This should be done for all the cells in the polygon (programmaticall...

Filling a Polygon: Performance of Winding Rule vs Even Odd Rule

For a complex polygon (ie: self intersecting) the choice between the Winding or the Even-Odd filling rules makes a difference in the way the polygon is filled. But for non intersecting polygons is there any performance difference between the Winding or the Even Odd filling rules. I understand it would be implentation specific but which ...

Looking for MsPaint alternative with alpha support

In our codebase I write many things that, for testing, depends on the image Im loading have alpha. Usually, I make all my own testimages/programmers-art in MsPaint. But every time I need an image with alpha, I have to go and disturb one of our artists. (Or start the loading of GIMP and go for a coffee break.) So Im looking for alternati...

Java: using WritableRaster.setRect to superimpose an image?

I have been playing with some of the imaging functionality in Java, trying to superimpose one image over another. Like so: BufferedImage background = javax.imageio.ImageIO.read( new ByteArrayInputStream(getDataFromUrl( "http://www.google.com/intl/en_ALL/images/logo.gif" )) ); BufferedImage foreground = javax.imageio.Ima...

Is there a library that can do raster to vector conversion, for the iPhone?

I am trying to take an image and extract hand written text so that it can be read easily and zoomed in on. I would like to convert the text to vector paths. I am not aware of any libraries that would make this as painless as possible. Any help is greatly appreciated. Examples are nice too :) ...

How do I get a Raster from an Image in java?

I'm trying to load a gif image from a url into a java.util.image.Raster so I can manipulate it. The only method for loading and decompressing an image I could find was Toolkit.getImage, which returns a java.awt.Image. I need to turn that into a Raster so I can work with it. Suggestions? ...

Video equivalent of PNG?

For raster images there is: JPG is for natural scenes PNG or GIF for geometric scenes that are characterized by smooth colors, straight lines and gradients. For vector animation there is SVG And for raster video there are various MPEG codecs which do a good job for natural scenes. So my question is, what should I use for a video which...

How would you implement Undo in a raster drawing program?

You're making a drawing program like Paint. You want to be able to undo/redo brush strokes. How would you implement this? Optimize for speed and memory. ...

Idea Wanted: Raster Online Map (Possibly with ESRI API and some geoprocess model)

(I hope this is a valid question) As I stated in my title, I'm looking for a fairly easy to moderately easy idea for some sort of online raster analysis map. I'm familiar with ESRI and their really awesome API, as I'm hoping to tackle something on that front. I'm also open to using the mapstraction lib. Does anyone have any ideas f...

Converting vector-contoured regions (borders) to a raster map (pixel grid)

I have a map that is cut up into a number of regions by borders (contours) like countries on a world map. Each region has a certain surface-cover class S (e.g. 0 for water, 0.03 for grass...). The borders are defined by: what value of S is on either side of it (0.03 on one side, 0.0 on the other, in the example below) how many points t...

Manage rotated moving raster map

Hi, My application present a (raster) moving map. I need to be able to show the map rotated base on any given angle. The program is currently in VC++/MFC but the problem is generic. I have a source bitmap (CBitmap or HBITMAP) and draw it to the device context (CDC) using StretchBlt. While this works fast and smooth for angle=0 (and the u...

How to detect and correct broken lines or shapes in a bitmap?

I want to find an algorithm which can find broken lines or shapes in a bitmap. consider a situation in which I have a bitmap with just two colors, back and white ( Images used in coloring books), there are some curves and lines which should be connected to each other, but due to some scanning errors, white bits sit instead of black ones....

Perfect line rendering in as3

I'm making an arcade game in as3 and I want to draw pixely(unsmoothed by flash) lines. I'm drawing the pixels 'by hand'(not with flash's lineTo or anything) onto a bitmapdata object. The lines don't appear quite right though, when zoomed out the line is rendered 2 pixels thick at some parts. However by zooming it its apparent that t...

Moving objects on screen by per pixel basis with glRasterPos()

I have the following code to render text in my app, first i get the mouse coordinates in the world, then use those coordinates to place my text in the world, so it will follow my mouse position: Edit: added buildfont() function in code example: GLvoid BuildFont(GLvoid) // Build Our Bitmap Font { HFONT...

How to increse performance of raster scrolling on Mac ?

I have a game with a big raster map Now we are using jpeg (4900x4200) And durring the game we need to scroll through this map. We use the following: Class Map extends mx.containers.Canvas and mx.controls.Image on it In constructor we have: public function Map() { super(); image.source = ResourceManager.interactiveM...

Best approach to storing image pixels in bottom-up order in Java

I have an array of bytes representing an image in Windows BMP format and I would like my library to present it to the Java application as a BufferedImage, without copying the pixel data. The main problem is that all implementations of Raster in the JDK store image pixels in top-down, left-to-right order whereas BMP pixel data is stored ...

What file format can represent an uncompressed raster image at 48 or 64 bits per pixel?

I am creating screenshots under Windows and using the LockBits function from GDI+ to extract the pixel data, which will then be written to a file. To maximise performance I am also: Using the same PixelFormat as the source bitmap, to avoid format conversion Using the ImageLockModeUserInputBuf flag to extract the pixel data into a pre-...

Extract points within a shape from a raster

Hi, I have a raster file (basically 2D array) with close to a million points. I am trying to extract a circle from the raster (and all the points that lie within the circle. Using ArcGIS is exceedingly slow for this. Can anyone suggest any image processing library that is both easy to learn and powerful and quick enough for something li...