We have just released TransGen, a utility based on GeoTools/Java. It allows you to generate a best fitting affine transformation from the set of control points.
The set of control points can be generated for example by our online tool prototype and has a simple text format: "latitude longitude pixelx pixely" per line. A sample of file with GCPS points and related JPG image derived from Natural Earth II is available in our code repository.
The utility generates a World File, which represents the best fitting transformation for given set of ground control points (GCPs) in a format that can be used by virtually any GIS system.
The process of image registration is done by an algorithm, which allows you to restrict some of the standard operations. By default all the six affine operations are applied (translate x, translate y, scale x, scale y, rotate, skew).
But you can set constant value for some of the operations, thus for example eliminating the skew/shear (this is what you need for generation of KML for Google Earth which only supports affine5) or rotation (when you know that the map has north orientation already). There is also a possibility to compute the best similarity transformation.
You can download the command line utility implementing this algorithms: