마음의 안정을 찾기 위하여 - [Delphi] 15 graphics effects demonstrations
1987042
406
569
관리자새글쓰기
태그위치로그방명록
별일없다의 생각
dawnsea's me2day/2010
색상(RGB)코드 추출기(Color...
Connection Generator/2010
최승호PD, '4대강 거짓말 검...
Green Monkey**/2010
Syng의 생각
syng's me2DAY/2010
천재 작곡가 윤일상이 기획,...
엘븐킹's Digital Factory/2010
[Delphi] 15 graphics effects demonstrations
Delphi/Graphics, Draw | 2018/12/19 13:28



 

Introduction

Here is a program written by Ivan Sivak (aka Ivanoslav), a bright, young 16 year-old Delphi programmer from Czechoslovakia.  

It contains 15 graphics effects demonstrations.  I don't know that any of them are original, but it is a fairly complete set of effects that can be obtained; mostly, except for the first two text demos,  by pixel manipulation.

I added some user edit fields for values that Ivan had hard coded and made a few other changes, but 90+% of the code is as he sent it.  

Here are the effects:  

bullet Raised text.  A clever way to give text a raised appearance by drawing darker text offset lower and lighter text higher on the screen.
bullet Rotated text.  Using the logical font escapement field to control the angle at which text is drawn.
bullet Image selection.  Copy a rectangle from one image to another.
bullet Pixel color filtering.  Remove Red, Green or Blue pixels from an image (leaving the other two colors to form Cyan, Magenta, or Yellow).
bullet Conversion to grayscale.  Replaces colors in each pixel  with a weighted average of the three.  The default weighting ( 0.2989 for red,  0.5866 for green, and 0.1145 for blue) is  the NTSC standard  that reflects the apparent brightness sensitivity of the human eye; least sensitive for green and most sensitive for blue.  
bullet Conversion to black and white.   If the weighted average of the three colors in a pixel  is higher than a threshold value, make  the pixel white, otherwise make it black.  
bullet Pixel distribution.  I have no idea what this is, but the it makes an interesting picture.
bullet Color inversion.  Make the "negative" of a color image by subtracting each color value from 255 for each pixel.
bullet Change contrast and brightness.  Here is where I made my most significant contribution to the project.  Ivan originally had  only two levels of contrast adjustment in his code.  I generalized that to multiple levels.  In the process I noticed that images tends to get darker as contrast in increased and decided that we also needed a brightness adjustment.  That led to a side trip into the world of HSV (hue, saturation, value) color representation.  This is also sometimes referred to as the HSB;   (hue, saturation, brightness) , system.   Adjusting brightness requires converting the RGB pixel value to the HSV system, adjusting the "V" (brightness) and converting back to RGB..  
bullet Making a relief image.  Convert each pixel to a gray scale constant plus the difference between the grayscale value of this pixel and the pixel three pixels up and to the left.  
bullet Pixel sorting.   Another one I did not look at much.  If anyone has any comments on it, I'll be happy to add them here.
bullet Blob deformation.  Replace the image with lots of randomly placed ellipses colored by averaging the colors of some pixels within the ellipse.
bullet Blending 2 pictures together.  Simply replace each pixel with the weighted average of the two corresponding pixels in the original images.  The weighting may be constant or varied.  The variation samples here are based on the X coordinate to cause a fade-in or fade-out effect.
bullet Sine wave deformation. Relocate each pixel based sine or cosine function applied to the coordinates.
bullet Bubble spot magnify deformation.  This is one of the screensaver effects in the MSPlus software package.   Here we just magnify an area around a clicked point.   I haven't analyzed how or why it works.  It seems to relocate pixels a distance inversely proportional to their distance from the clicked point.



출처 : ://www.delphiforfun.org/Programs/Delphi_Techniques/graphics_effects.htm
2018/12/19 13:28 2018/12/19 13:28
Article tag list Go to top
View Comment 0
Trackback URL :: 이 글에는 트랙백을 보낼 수 없습니다
 
 
 
 
: [1][2][3][4][5][6][7][8] ... [1404] :
«   2019/06   »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
전체 (1404)
출판 준비 (0)
My-Pro... (41)
여행 (42)
사는 ... (954)
블로그... (25)
My Lib... (32)
게임 ... (23)
개발관... (3)
Smart ... (1)
C Builder (0)
Object... (0)
VC, MF... (9)
Window... (1)
Open API (3)
Visual... (0)
Java, JSP (2)
ASP.NET (0)
PHP (4)
리눅스 (28)
Windows (27)
Device... (1)
Embedded (1)
게임 ... (0)
Web Se... (2)
Web, S... (19)
잡다한... (4)
프로젝트 (0)
대통령... (9)
Link (2)
Delphi (96)
Reference (1)
OpenSo... (5)
Apache (2)
Database (21)
프로그램 (0)