comparing GIF images pixels - image

I need to compare 2 same-size, nearly identical images for exact differences in the RGBs of every pixel.
I would like to find a tool that already does it... seems nowhere to be found on google, strangely.
If I could even find a tool to print out the RGB values of every pixel I could compute it by hand (the images are small enough) or load that input for my tool. Again, couldn't find anything.
Otherwise I look for a simple C library to decode GIFs and access each pixel... recommendations? I see quite a few on google, most look old and have no documentation.
I hope someone with more exposure to image processing can help me solve this this somewhat trivial task in one way or another without spending too many hours!!

If you have ImageMagick installed, it already does it.

What about SDL + SDL_Image (main site)?
You can easily open GIFs and load them on SDL_Surfaces to retrieve the pixel information you need..

If you're not opposed to Python, one option would be to use the Python Imaging Library (PIL), which provides Python bindings for native decoders for many file formats, including PNG and GIF.
This past summer, I wrote a few small apps to do RGB-wise comparisons of PNG images, in C++, pure Python, and Python using PIL. It would be trivial to make the PIL code work with GIF images.
If you want to roll your own, the "standard" C library for simple image manipulation is GD.

Beyond Compare will do image comparisons and highlights differences.
http://www.scootersoftware.com/

Related

Converting Image in png format to vector format using Sketch (Mac)

I am new to sketch and I am facing some issues in generating Vectors for some of the icons which I have in .png format.
Could any one please refer some tutorial or tell me some simple way to get through this.
Feel free to guide me if I am wrong somewhere.
Thanks
Sketch is very useful but it is also limited on its vector capabilities. The function you are looking for is called Live Tracing, you can find it on Illustrator and it is very acurate if your icon is in high contrast or transparent background. You could trace it manually but that can take a long time for complex shapes, and not as accurate.
Inkscape might be a good free option for this. Should be good enough if the pngs are not too detailed.
Himanshu,
I also faced same issues but I think there is no such easy way to get out of this using Sketch.
but still, you can review this basic Youtube tutorial for the same.
https://www.youtube.com/watch?v=RKT8pDVrYtY
Hope this helps you out buddy.
Happy designing.

opencv or imagemagick for highlighting differences

I am working on a project in which I need to highlight the difference between pair of scanned images of text.
Example images are here and here.
I am building a webapp based on HTML,JS for this.
I found that openCV does support highlighting differences between 2 images.
Also I saw that imageMagick also has such support.
Does openCV has support for doing automatic registration of images?
And is there a JS module for openCV?
Which one is more suited for my purpose?
1. Simplistic way:
Suppose the images are perfectly aligned and similarly illuminated: subtract one image from another pixel by pixel, then threshold the result, filter out noisy blobs, and select the biggest ones. Good for a school project
2. A bit more complicated:
Align the images, then find a way to uniform the illumination, then apply the simplistic way.
How to align:
Find the text area in two images, as being a darker than the file color.
Find its corners
Use getPerspectiveTransform() to find the transform between images.
warpPerspective() one image to another.
Another way to register the two images is by feature matching. It has quite an extensive support in OpenCV. And findHomography() will estimate the pose between two images from a bigger set of matching points.
3. Canonical answer:
Align the image.
Convert it to text with an OCR engine.
Compare the text in the two images.
Well, besides the great help given by vasile, you also need the web app answer.
In order to make it work in a server, you will probably need a file upload form, as well as an answer from the server with the applied algorithm. There are several ways you can do it depending on the server restrictions you have. If you can run command line arguments, you would probably need to implement the highlight algorithm in opencv and pass the two input files a an output one for the program. A php script should be used for uploading the files, calling the command line program, and outputting the result to the user.
Another approach could be using java and JavaCV in a web container like Apache Tomcat, for instance.
Best regards,
Daniel

Raster image drawing software/library with deepzoom

I'm looking for a raster image drawing software with an "infinite" zoom capability like the image viewer SeaDragon(YouTube-link). Or, alternatively, a library (in any language) with which one could build such a drawing software.
I want to draw images without having to think about resolution, being able to add ("infinite") detail wherever I feel like it.
I think you might be looking for DeepZoom Composer. There are a number of projects starting up at OpenZoom as well. Although this is relatively new, so the quality is still rather rough.
Take a look at the piccolo project: http://www.piccolo2d.org/ There is a demo app for drawing which might do what you want, but it's quite easy to make your own. Java + C# versions were pretty good last I checked (last used the Java version about 3 years ago).

Quality for images in LaTeX documents

What are some of the points that I need to follow if I want to have good quality images in a LaTeX document. These images are mostly screenshots of a software application or flow charts.
Below are two such images.
Flow Chart
Screenshot
Thanx
For diagrams, the rule is to use vector formats as much as you can — PDF, EPS or native LaTeX packages. When using vector graphics, the picture does not loose resolution and can be scaled freely. For a flow chart, I would either export it from the drawing application as a PDF, or use PGF/Tikz to produce it from LaTeX (see also examples). If your drawing application does not have a PDF export, consider using one that does — e.g., UMLet.
If you can't use vector graphics (e.g., because it is a screenshot), make sure you use high-enough resolution to begin with. If it is an academic paper, the publisher usually has guidelines for this.
If you use PDFLatex you can use png images and in those cases you definately should use png over jpeg. PNG compression is not lossy, so you get the best quality at the expense of file size.
The second important point is to create the images with sufficient resolution, for printing it should be about 300-600 dpi, higher is better but the filesize of the images and the resulting document will increase. For documents that will only be looked at a screen you can use a lower resolution, about 72-100 dpi should be enough.
For diagrams you should create vector graphics (eps or pdf) if possible, that way you do not lose any quality.
For screenshots, there is not much to do, but for flow charts, I'd suggest to create them in PDF format (vectorized) and to compile your LaTeX source with pdflatex.
for the flowchart i'd suggest TikZ, then your chart is directly typeset in TeX. Here's an example: http://www.texample.net/tikz/examples/simple-flow-chart/
Screenshots are pretty much a lost cause. I've had a good experience saving them as PDF and then embedding them, but you want to make sure you're on a high-res capture to begin with.
Charts are very easy. Most graphics programs (e.g., Vizio, OmniGraffle) will let you save it as EPS or PDF, and scaling works fairly well.

How Is The Structure Of a Image

I'm thinking to build a library to manipulate images(my own image type that I will develop), but first I need to understand the structure of a image
How it is mounted?
About the layer technology...
Where I can find some good resources to understand these things?
Thanks.
That all depends on the image format in question.
Most image formats, however, consist of the following:
A header that contains general file information (how long, what format, dimensions, color space, compression algorithm, etc.)
The pixel data (potentially compressed, in which case some other structure may apply)
Other metadata (EXIF, ...)
Many popular image formats such as JPEG or PNG have freely available specifications of the file format.
If you actually want to work with more complex images, containing layers and such (possibly Photoshop or similar) then things get more difficult. They additionally contain layers, so multiple chunks of pixel data, maybe metadata for the layers, in the case of Photoshop even vector data (for layer masks and other paths), etc.
What's more, most primary file formats used by major proprietary image editing software tend to be not fully specified, at least not publicly. There are resources out there but expect them to be incomplete at best.
Still, starting a project like this without much prior knowledge of image file formats in general might not be a feasible idea.
A good start to everyone that needs to know the basics about digital images is the chapter 2 of the classic book by Gonzalez and Woods, Digital Image Processing.
A short answer, roughly speaking: for manipulation in memory, images are 2D arrays. There are lots of variants, but the 2D array is the classic way.
For C, C++ and Python, take a look on OpenCV. For Python, see PIL. For Java, see JAI. Finally, to a overview about an "image structure", take a close look inside IplImage structure in OpenCV documentation.
Image file formats vary wildly. However, depending on which language/platform you're coding against, you may have generalized means of working with images and translating them into the format you chose. Each platform will have its own means of building and accessing images, however, so there's little I can tell you of substance without a declaration of your programming platform of choice.
Personally, I prefer C#/.NET. So here are some links on image manipulation in that platform:
http://www.aspfree.com/c/a/C-Sharp/Basic-Image-Manipulation-using-GDI-and-C/
http://www.aspfree.com/c/a/Code-Examples/Handling-Animation-and-Bitmaps-Using-GDI-for-Image-Manipulation/
Each image format, has a differant structure and comprresion.
Maybe you should explain in more detail your goals.
A quick amazon search yields a couple of books that could be very useful on the subject. Both are based around openGL, one of the most common graphic libraries. The first is a general introduction to computer graphics sort of text book and the second is a manual for openGL (commonly known as the red book).
Computer Graphics with OpenGL (3rd Edition)
OpenGL Programming Guide (The Red Book)
I can personally attest to the usefulness of both books.
If you're interested in the innards of various image file formats wotsit is a pretty good start. If you prefer hardcopy then go to the Encyclopedia of Graphics file formats. And if you want to look at sample sourcecode check out imagemagick. It can open-, convert to-, and save- most popular image file formats written in C++ with interfaces to most other languages.
Unless you're doing something very unique, I would encourage you to use an existing file format. Look at PNG or TIFF. They are incredibly flexible.
As a veteran in the field, I would say that the last thing the world needs is a new image file format. ;-)

Resources