` HaftiX - How HaftiX works
Bookmark and Share

How HaftiX works and why the patterns may turn out to be different than you expected.


    I will try to present the way HaftiX works and explain any doubts concerning “why the cross-stitch pattern turns out to be different from what I wanted”. All examples will be illustrated with an image I received from the application user. The problem concerned obtaining appropriate, expected quality of the pattern.

    Article for: beginners.
    Author: Grzegorz Zochowski
    Copying text and images without author's consent prohibited. It is allowed to refer to the content by including a link or this page in a HTML frame.

    Why HaftiX selects more colours than there are on the image?

    The beginning is simple and intuitive – the application opens an image selected by the user.

    Next, define size of the cross-stitch, size of a cross in the “Conversion” window and then, based on these data, the size of cross-stitch expressed in crosses is calculated.
    The first sight proves that it will be possible to process the image with literally several colours. Why then it isn't so?
    To answer the question, it is necessary to recall some properties of human sight.
    The eye cheats on us very often and we are not aware of that. It can correct the image seen to a large extent. A simple experiment – if it is dark outside and you are sitting with lights on, what colour is a blank piece of paper? White? Our sight tells us yes but it is possible to take a picture of this paper with a camera which does not correct white balance (let's not elaborate on what it is, it does not matter now) and it will turn out that the piece of paper is probably orange, if you have a bulb or a lamp emitting “warm” light on. It happens so because we have learnt that the paper is white and how white looks like in artificial light and we see no difference.

 This is what we see  This is how it looks in reality
Picture on the right shows how really a white glove looks like at artificial light. Human eye is easy cheated on and it sees what is shown on the left picture. A camera has no scruples and neither has a computer.

    Another forgery at images perception is the fact that eyes mix colours. If you take any newspaper with colourful pictures and you try to specify a selected colour, try to look at it through a magnifying glass.

 This is what we see  This is how it looks in reality
Both images show the same part of a newspaper picture but at various zoom.

    To sum up – please do not trust your eyes, they are professional liars, which you will soon realize.
    Let's go back to our image which at the first sight consists of several colours and it is obvious to us. Let's see how it looks zoomed:

Parts of image showing a dancing couple zoomed.

    As you can see, an impression that there are few colours is only an illusion. The image contains almost 20 thousand colours. Yes, it is not a mistake. There is as many of them. The application is not as easy to be cheated as a human and it takes for calculations what there really is – all the medley of colours. It is partly an answer to the question where all the colours in a processed pattern comes from. By the way, let me add that images saved as jpg files always are so many-coloured. GIF and BMP files are less cluttered but that does not mean that it is enough to convert a jpg file into GIF to have better quality. High quality is impossible to be restored, unfortunately.
    Another reason of too large number of colours in a pattern results from the fact that the cross-stitch pattern consists of quite large single-coloured squares. Let's assume that the target pattern will have 10 x 13 crosses. Graphically, each cross will correspond to a field of quite large surface area:

    Now choose any field in the middle of the image and try to tell what colour it should have. Difficult, isn't it? The application did the task the following way:

    It is a result of ordinary mathematical calculations and although the effect is unsatisfactory to a large extent, it is impossible to do it any other way. Going back to the multitude of colours in a pattern – if there are several colours in a given field (for example, a red skirt, a grey shirt, a black hand and white background), the application calculates an average of all those colours and a new colour is created. It happens many times during the transformation of the image into a pattern and you need to take into account the fact that intermediate colours between those present on the image will appear.
    The image discussed does not contain another phenomena which are frequent in case of pictures which later cause astonishment with their result. Typically, it is about unnatural colours of faces. Not many people can notice that this is the way they are on the photo, since cameras of low class and amateur photographers are not able to take a photo in such a way that the colour of skin is warm and not livid or even purplish. Therefore, if you want to have a nice pattern, you should first graphically process the photo. It is a separate and quite complicated issue.

    In what way HaftiX minimizes the amount of colours?

    A problem separate to obtaining too large number of colours is... their too small number. If we want to cross-stitch a rainbow, we will surely not find threads in colours which would be necessary. So, the question arises – how to transform a many-hued images into several or several dozen colours to get the best effects?
    There is no universal answer to this question. The application is equipped with some compromising solutions which in some cases give worse results. We can consider a situation that you need, for example, 20 thousand various colours. It is not a large amount, a photo rarely contains less. To replace the amount with several dozen colours, we can do the following: group all hues into groups containing colours similar to each other (for example, shades of light green, dark grey, etc.) and from these groups choose one that will replace all others. This method may seem good but only for short time. In case of 10 colours you need to create 10 groups containing 2 thousand colours on average. It is easy to imagine how much information you will lose if you replace 2 thousand colours with one.
    Another method consists in finding colours which are the least frequent and replacing them with the most frequent ones. The procedure in our case would consists in finding 10 most frequent colours and replacing all of them with one of them.
    The abovementioned methods have their significant disadvantages. The first one selects replacement colours for the most frequent shades in a worse way. The other method – selects colours for the least frequents ones in a worse way. The HaftiX application uses the first method since the other was not the best for processing photos of faces (the proper colour of lips, eyes was lost and these are small areas but of characteristic colour). Improvements of this mechanism are in progress and in the future it should be more "smart".

    What can you do?

    To get a desired effect, you may transform the image using a larger number of colours first, for example, 16. You will get the following pattern:

    Next, with the “pencil” or “fill in” tool, erase the captions which so and so are illegible, unify the frame (“pencil” with Shift button pressed draws straight lines).
    Using the colour replacement tools, change some colours present in the jacket and skirt into dominating colours. Please pay attention to the man's doublet. The darker colour has been replaced with lighter one. If you want to do similar operation, I recommend to learn and train how to use the colour replacement tools. I strongly advise against using the “fill in” tool which may leave single crosses somewhere.
The result is as follows:

    The number of colours decreased to about 10. We can also eliminate the cherry-brown colour present in the lower part of the skirt and the replace the slightly livid colour on the shirt of the lady with grey. With the “pencil” tool correct the beads. Number of colours – 7.

    After next operations, it is possible to get a four-colour pattern.

    It depends only on the taste of the person stitching whether this effect is satisfactory or maybe the one more rich with colours is better. Sometimes it is worth to leave larger number of colours. Compare last two patterns and pay attention to the raised hand of the dancing lady. Larger number of colours on the first image allows smoother colour change, edges are also smoother thanks to those additional colours. It is doubtless, a matter of taste.
    When using the application skillfully, it is possible to prepare such pattern within 10 minutes. I encourage you to read the manual, try new tools, practice work with patterns. It will surely result in better patterns.


About | Gallery | Contact | Guides | Help | Download | Bookmark and Share