ZX News #03
28 февраля 1997

Smoothing Images - An algorithm of smoothing of static images.

<b>Smoothing Images</b> - An algorithm of smoothing of static images.
(C) 1997 Serge Segal


  Dithering algorithm for image.



  In this article we'll discuss

  smoothing algorithms for static
  optical images. First

  We will understand why this is necessary, but

  you can then have to disassemble itself

  process.


          So, why is it necessary?



  Everyone who has seen the program "EXTACY MD"
Groups "RUSH", remember the part where
rotates the inscription "XTC". Since it is
rotates rapidly, imperceptibly, that the lines
components of its look, to put it mildly,
not a pretty sight, somehow zubtsevato.
The thing that used a 3D-image editor that does not smooth out 
lines. Now all the editors for 3D-graphics on powerful machines 
do it. For this purpose a specially modified algorithm

Drawing lines and circles. This is what we
describe in the next issues of our
magazine, and now, about how this problem can be solved without 
changing the code editor. You can write your own algorithm 
which automatically flatten the line. 


  The second application of smoothing - correction of enlarged 
bitmaps. The problem of angularity Pictures come across anyone 
who has worked in the editor "Art Studio" with the increase, 
especially with the disproportionate. Such an enlarged picture 
should also be smooth. 


 As all seems to work, this algorithm



  In the old tradition we do not consider the complex and 
maloprimenimye for "ZX-Spectrum" algorithms. So intelligent 
smoothing processes one Zoom in about an hour. The effect, of 
course ... But here's the performance like something is pulling 
... So I came up with a different algorithm smooth, easy-to 
idiocy, but At the same time, working quickly

and giving reasonable effect. Algorithm consists of two parts: 
smoothing lines (For vector images) and smoothing the corners 
(to enlarge An image). Run both algorithms on the same

principle: scanning the screen in search of
template and replace the template on the more beautiful.

                As can be seen, for the first

                algorithm, we find

       => Tooth and replace it with

                square or corner.

                What will change, according to
   | | Shows variable DOU
                BLE, if 0 - then the tooth

                otherwise the square. Recommendation
                through each for increased every
                mappings square, and for

                vector - a nook.

Second pass - smoothing angles works with the matrix 3 for 3.


                     Similar to the first,

                    This algorithm is replaced
                    preserves angles in a triangle
         => Lnye teeth. No

                    complexity in this

                    No, the main thing - the right
                    correctly remove the matrix

                  and the right to return it
in place. Also had to introduce
forced inversion for some pictures for a while smoothing 
(variable INVERT). After the end of the smoothing, the image 
returns to the non-inverted state. 


  In addition to these there are two variables of process 
control: FIRST and SECOND, enabling / disabling the first and 
second algorithms. And of course the coordinates of the window, 
which smooths out: X1, Y1, X2, Y2. 


  Attached you will find:


      - SGLAV1.Z, SGLAV2.Z two source

        File algorithms with comments

      - SGLAV2 code file ready to

        Uses

      - SGL.EXMP example of using

      - $ BASHK1 picture - an example.


  All right, maybe enough for today. In
further rooms, we might (!) continued the theme of perversion 
of the pictures. 



  ____________________________________




Other articles:

From the Author - Innovation in the viewer.

Anketirivanie - Answer the 10 questions and takes you to the encyclopedia "SPECCY individuals."

Review magazine - On journals: SPECTROFON, ZX-FORMAT, ADVENTURER, SPECCY, FAULTLESS.

My dog - Fox Terrier - dreams and reality.

ANDY CAPP - Game Description ANDY CAPP.

WEC LE MANS - A small opening WEC LE MANS.

RED HAWK - description of Game RED HAWK.

Rotating pictures - rotate the image, the algorithm with respect to a given center.

Smoothing Images - An algorithm of smoothing of static images.

morph pictures - The effect of soft peretikaniya one image to another.

Last Starfighter - Presentation Lugansk Game - THE LAST STAR FIGHER.

As you know Spectrum - test "How well do you know Spectrum".

Abbreviations - the standard abbreviations (which everyone should know).

War of Fennec - one-day chronicle of war (Game Section Tolkinovskogo Society in action).

RPG - A bit of role-playing games.

clever ideas - Smart thoughts of great men.

Letters from readers - The first responses from readers of the Journal: A Novel Rublachenko, Vyacheslav Sadonenko, Impetus Led.

Report for the year - A year has passed ... since the first issue.

Coming soon - what awaits you in the 4 th issue.

Application - Smagli-3 demo, Andy Capp, Red Hawk!, SGLEXMP, Crystal Dream members in East Ucrainian State University, Screen Editor, Rotate, Morph, Last Star Fighter, UFO-2 Help.

Advertising - Advertising and announcements ...

Authors - The authors of the magazine.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
BBS INFO - News from the PROFI-BBS (Issue 2).
Humor - anecdotes.

В этот день...   23 November