Add Text to Image is blocky

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

janderson
Posts: 2
Joined: Wed Oct 21, 2020 3:20 am

Add Text to Image is blocky

Post by janderson »

I like to put a name on a photo in case it gets separated from its label/description. When I click on Image/Add Text, the process goes all right. But the name is so blocky it is not attractive at all, and quite unusable. Am I missing something or is a smooth text impossible. Thanks
cday
XnThusiast
Posts: 3884
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add Text to Image is blocky

Post by cday »

janderson wrote: Wed Oct 21, 2020 3:29 am I like to put a name on a photo in case it gets separated from its label/description. When I click on Image/Add Text, the process goes all right. But the name is so blocky it is not attractive at all, and quite unusable. Am I missing something or is a smooth text impossible. Thanks
I would suspect that the pixel dimension of the image to which you are adding text are not large enough to support smooth text...

You could try making a copy of the image and then resizing it to double the number of pixels in the width and height, which may produce an image with at least slightly better quality text.

Note: Larger text if you can use it is more likely to display acceptably.
User avatar
oneto
Posts: 10
Joined: Fri Sep 07, 2007 4:01 pm
Location: Grasse

Re: Add Text to Image is blocky

Post by oneto »

Hi,
Another thing which could make the text blocky is using a lossy compression format like JPEG, especially with a high compression.
Best regards,
Jean-Louis
janderson
Posts: 2
Joined: Wed Oct 21, 2020 3:20 am

Re: Add Text to Image is blocky

Post by janderson »

Even before I save the image with text added, it looks like the word(s) were assembled with blocks. Especially with an outline. The best results I get are from importing a picture to Microsoft Word, typing the name (usually in Arial Black), then print screen, and importing clipboard into Xnview, then crop how I want, and save (still in Xnview).

Even if I bring the result into Photo Rar to compress, the results are much better than using Xnview by itself to add the text.
Photo Rar also allows text to be added, but not move freeform, and only in the corners. The text is much smoother than using Xnview to add test.

What would be great is if Xnview could add smooth text to any graphic like Word can, allow the name to be free-form moved anywhere, then compressed (if wanted) like Photo Rar can.

There would be a demand for this as many users want the name either on the picture or just below.
cday
XnThusiast
Posts: 3884
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add Text to Image is blocky

Post by cday »

janderson wrote: Wed Oct 21, 2020 6:04 pm The best results I get are from importing a picture to Microsoft Word, typing the name (usually in Arial Black), then print screen, and importing clipboard into Xnview, then crop how I want, and save (still in Xnview).
Interesting, I wonder if the text added in Word is anti-aliased: if you zoom in to an image created that way, do you see (with black text) pixels with shades of gray at the edges of characters?

That is how the appearance of text can be enhanced, and is why text scanned in grayscale can look smoother than text scanned in black and white at the same resolution.
cday
XnThusiast
Posts: 3884
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add Text to Image is blocky

Post by cday »

More:

It would be interesting to know how text applied to the same image using another image editing software displays, I suspect about the same, but if better that would suggest that the text tool in XnView MP could potentially be improved.

Regarding pasting your images into Word, adding text and then making a screenshot, I am wondering if Word might possibly, if the displayed image is enlarged, add additional pixels automatically. That doesn't seem very likely, but could explain the results you are obtaining.

You could easily check whether that might be happening by comparing the pixel dimensions of your XnView output and your Word screenshot output; if that proves to be the explanation you should be able to obtain the same, or better, result directly using my suggestion above to resize the image pixel dimensions before applying text in XnView MP. That method should be better overall, and you could batch convert the image resizing step before later adding text if you have many images to process. Test using copies of your original images in case of a misstep!

If the problem remains unsolved, maybe you could post an example image produced using XnView MP, and the better result obtained using Word.
cday
XnThusiast
Posts: 3884
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Add Text to Image is blocky

Post by cday »

Another thought, in case anyone else encounters the same issue:
janderson wrote: Wed Oct 21, 2020 6:04 pm The best results I get are from importing a picture to Microsoft Word, typing the name (usually in Arial Black), then print screen, and importing clipboard into Xnview, then crop how I want...
When the screenshot is made it seems unlikely that the pixels in the original image, before it is pasted into Word and the text is added, will correspond exactly with the pixels in the screenshot: I suspect that could produce the apparent smoothing of the text observed in screenshots. The image on the screen might well also have more pixels, particularly on a high resolution screen.

If that is the case, a similar or possibly better result might be obtained more easily by applying a filter (Image > Filter...) directly to the XnView image after the text has been added. The 'Blur' filter provides fine control of the level of filtering, or possibly one of the other filters such as 'Soften' might produce a better result. If the same setting is satisfactory for multiple images, the filter action could be batched providing further streamlining of adding text.

To sumarise:

It seems likely that the blocky text observed using XnView software is ultimately due to the images to which text is being applied having fairly small pixel dimensions (width and height), and similar results would probably seen using other image editing software's.

Two possible ways of obtaining better quality text would be to:

o Increase the pixel dimensions of the images to which text is to be added using Image > Resize... ;

o Apply a smoothing filter to the image after text has been added.

The best possible results might be obtained by using each of the above actions successively, and both might be batched to streamline the workflow when many images need to have text added.