Content here is by:
Michael Still
mikal@stillhq.com

All my Open Source projects
Extracted view of CVS
Home
Site map

See recent comments. RSS feed of all comments. Raw dump of all comments for research purposes.

ImageMagick book
MythTV book








Fri, 04 Feb 2005



Imaging concepts: Encrypting images

    DES in Electronic Code Book (ECB) mode is a particularly poor choice of cryptography for image files. This is because ECB mode implements a look up table between the unencrypted value and the encrypted value. This results in a known input value turning into the same output value over and over. This can have some interesting blurring effects, but wont obscure the image contents. An example will help this make more sense -- the first figure is the logo for the company I am currently working for. I took this image, and ran it through some DES ECB code and produced the second figure.





    You can see that whilst the image has certainly changed, the contents of the image has not really been obscured.

    We should note that ECB mode is not commonly used anyway. If you use something like PGP or blowfish, then you should be much happier...

posted at: 02:01 | path: /imaging | permanent link to this entry


Wed, 02 Feb 2005



Imaging concepts: Anti Aliasing

    Imagine that you are drawing a triangle across an image (or on the screen for that matter). The triangle is sometimes going to cross pixels in a way which makes them not totally turned on. Have a look at the figure below to see what I mean...



    If we only have a black and white image, then we'll end up with an image like the one in the figure below. I am sure you'll agree that this isn't a very good representation of the side of the triangle.



    Anti-aliasing is when we try to correct for this problem by inserting some gray pixels. In the figure below, we have given some of the pixels a gray value which is based on how much of the pixel is "filled" with the triangle.



    The triangle might be a little clearer without the grid lines.



    If you compare that with the triangle we started with above, then you can see the obvious difference.

    So, in summary, anti-aliasing is the process of turning on some extra gray scale pixels to improve the look of shapes we are drawing... Now, whether you actually like anti aliasing or not is another matter. A lot of people, especially those with LCD screens, complain that anti aliased text is "fuzzy" and hard to read. That's the reason you can turn anti aliasing off in more recent versions of Microsoft Windows.

    Technorati tags for this post:

posted at: 21:53 | path: /imaging | permanent link to this entry


Assumed knowledge

    There are some things which I assume you know, and which are outside the scope of this tutorial.

    C

    This tutorial discusses code. Almost all of the code discussed is written in C. It is therefore safe to assume that if you don't have a good working knowledge of C, then you're likely to get a lot less out of this tutorial as those who do know some C. On the other hand, don't worry about the more esoteric syntax, I'll explain this as we need it.

    It should also be noted that the code samples in this tutorial are not optimal. They have been written to be as readable as possible, and not necessarily the most efficient possible. Please bear this in mind before blindly copying them.

    How to compile and link on your chosen operating system

    It is outside the scope of this document to teach you how to compile and link source code into an executable form on your chosen architecture and operating system. You will need to understand this before you will be able to use any of the code in this document.

    For those of you using gcc on a Unix (or Unix-like) operating system, then the following points might be all you need to know. If you need more information, then a http://www.google.com search will serve you well.

    • Libraries are added to the link command using the -l command line option. For instance, to compile and link the source file foo, with the tiff library, you would use a command line along the lines of gcc foo.c -o foo -ltiff -lm.
    • You need to include -lm almost always. When you compile a c program using gcc without specifying any libraries, you get a -lm for free. As soon as you start specifying any libraries (for instance in this case -ltiff), then you also need to explicitly specify the math library as well.
    • You will almost certainly also need to add the library and include paths for the installed version of the relevant library to the compile command line as well. Directories are added to the library search path using the -L command line option. Include directories are added with the -I option.
    • The make files included with the samples in this tutorial a probably a bad place to look for introductory compile examples, as they use automake and autoconf to try to detect where the various required libraries are installed...


    Technorati tags for this post:

posted at: 21:05 | path: /imaging | permanent link to this entry


An experiment in online authoring -- my image programming tutorial

posted at: 21:04 | path: /imaging | permanent link to this entry