archive-com.com » COM » E » EFG2.COM

Total: 878

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • efg's ColorChart Lab Report
    7 5 PB 2 90 12 7 vivid purplish blue 14 green 0 305 0 478 23 4 0 25 G 5 40 8 65 strong yellowish green 15 red 0 539 0 313 12 0 5 R 4 00 12 0 strong red 16 yellow 0 448 0 470 59 1 5 Y 8 00 11 1 vivid yellow 17 magenta 0 364 0 233 19 8 2 5 RP 5 00 12 0 strong reddish green 18 cyan 0 196 0 252 19 8 5 B 5 00 8 0 strong greenish blue 19 white 0 310 0 316 90 0 N 9 50 white 20 neutral 8 0 310 0 316 59 1 N 8 00 light gray 21 neutral 6 5 0 310 0 316 36 2 N 6 50 light medium gray 22 neutral 5 0 310 0 316 19 8 N 5 00 medium gray 23 neutral 3 5 0 310 0 316 9 0 N 3 50 dark gray 24 black 0 310 0 316 3 1 N 2 00 black Two sets of RGB values are given below for the ColorChecker The color values in Munsell Notation were converted to RGB values using the Munsell Conversion Program Version 1 5 Beta which was available for free testing in late 1997 See www gretagmacbeth com and www munsell com munsell1 htm I still have a screen capture for each color patch These RGB values are used in the ColorChart program I do not know where to obtain that program today The RGB values from the Munsell Conversion Program do not seem to be very accurate when displayed using the program ColorChart When scanned with a Paperport Scanner the RGB values appear to be more correct The scanner RGB values are from a 60 by 45 pixel area within each color patch Here s what the scanned and reduced ColorChecker looks like RGB Values for ColorChecker Munsell Conversion Program Paperport 5300 Scanner No Name R G B R G B 1 dark skin 129 96 82 92 67 52 2 light skin 205 163 144 190 147 127 3 blue sky 112 135 169 93 117 143 4 foliage 103 121 81 76 103 64 5 blue flower 146 142 188 127 127 162 6 bluish green 120 198 182 120 186 174 7 orange 223 141 57 200 120 58 8 purplish blue 91 106 178 72 90 148 9 moderate red 203 106 114 191 89 90 10 purple 107 74 122 75 43 82 11 yellow green 173 197 78 154 188 96 12 orange yellow 233 175 61 208 164 77 13 blue 65 75 163 32 55 127 14 green 88 160 87 78 138 86 15 red 186 70 73 172 44 39 16 yellow 240 208 47 230 209 95 17 magenta 197 103 162 185 92 128 18 cyan 0 146 178 67 122 157 19 white 249 248 248 254 254 253 20 neutral 8

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/ColorCharts.htm (2016-02-14)
    Open archived version from archive


  • efg's Color Range Lab Report
    If the image is smaller than or larger than the 640 by 480 area on the screen select the Stretch Checkbox so the image fills the area Move the cursor over the image to observe the R G B or H S V values Select ranges of R G B H S V by first selecting the corresponding Checkbox and then using the SpinEdit boxes to specify minimum and maximum values Note Hue minimum values can be negative For example a Hue range from 20 to 20 can be specified for a broader range of red colors Select the Exclude Color by clicking on the TShape area and selecting a color from the TColorDialog Select the Include or Exclude radio button if desired After the R G B H S and V ranges and the Exclude Color have been specified click on the Update button to see the resulting image If desired save the resulting image by pressing the Save Button Discussion Compare the Tulip image shown above with the one from specifying only a range of Red from 125 255 The two images are very similar Since Yellow Red Green a high value of red alone is fairly useful here Experiment with the famous Mandrill monkey picture In particular the red nose can be extracted with Hue from 20 20 and Value from 200 255 The blue cheeks can be extracted with Hue from 190 280 and Value from 128 255 At present ColorRange only loads BMP or JPG files With some minor changes WMF and EMF files could also be loaded For GIF support you will need a GIF component such as TGIFImage from Anders Melander Change the conditional compilation value to GIF and extend the file types allowed by OpenPictureDialog s filter A ColorRange INI file remembers

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/ColorRange.htm (2016-02-14)
    Open archived version from archive

  • efg's RGBColors Lab Report
    color but configured for 256 color mode dithering was never observed On two other machines that support high color 16 bit color dithering was always observed in 256 color mode Sixteen 16 of the 20 System Palette Colors are defined in Delphi s Graphics PAS unit There are an additional four colors that NEVER dither even in 256 color mode which were defined in Microsoft Systems Journal Sept 91 page 119 for the Windows 3 0 Default Palette Additional Non Dither Colors TColor Palette Color R G B clMoneyGreen TColor C0DCC0 8 192 220 192 clSkyBlue TColor F0CAA6 9 166 202 240 clCream TColor F0FBFF 246 255 251 240 clMediumGray TColor A4A0A0 247 160 160 164 The 20 Windows colors that never dither in 256 color mode can be selected in a combobox The ColorToString function from the Graphics unit displays the color name or hex value Windows device and raster capabilities are displayed in a memo box The following information about Color Specifiers is from The Tomes of Delphi 3 Win32 Graphical API Color Specifier Description 00 When limited by the hardware Windows dithers the 20 system colors to obtain a color match This form indicates the lowest 3 bytes contain relative intensity values for the blue green and red components of the color The color specifier will be in the form of 00bbggrr If necessary this color specifier will result in a color generated by dithering the 20 static colors to create the closest approximation to the requested color Use the RGB function to create this kind of color specifier 01 The low order byte represents an index to the currently realized logical palette The color specifier will be in the form of 010000nn Use the PaletteIndex function to create this kind of color specifier 02 Windows locates

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/RGBColors.htm (2016-02-14)
    Open archived version from archive

  • efg's HSV Lab Report
    black to 1 0 white For S 0 Hue is undefined When R G and B as well as S and V are defined over the range 0 0 to 1 0 these values are often represented in 8 bits with an integer value ranging from 0 to 255 Foley et al in Computer Graphics Principles and Practice Amazon link pages 590 593 describe the HSV color model as a single hexcone versus the double hexcone of the Hue Lightness Saturation color model While the text describes the space as a hexcone the color plates II 7 and II 8 show a circular cone Implementation Details The RGB HSV conversions are in the HSVLibrary unit There are two sets of conversion routines When only a one way conversion is needed from HSV to RGB and the result is to be a TRGBTriple the function HSVtoRGBTriple can be used For a one way conversion from a RGBTriple back to HSV quantities use the RGBTripletoHSV These are one way routines since the converted values are treated as integers See the actual code for implementation of these routines The RGBtoHSV and HSVtoRGB routines can be used when reversible conversions are needed Sometimes conversion from RGB to HSV is needed for some sort of HSV manipulation When complete the HSV values must be converted back to RGB If floating point values are not used to represent the converted values integer truncation is not always desirable The general conversion routines are shown below see the actual code for complete details RGBtoHSV USES Math MaxValue IEEE754 NaN IsNaN SysUtils Exception TYPE EColorError CLASS Exception TReal DOUBLE RGB each 0 to 255 to HSV H 0 0 to 360 0 corresponding to 0 360 0 degrees around hexcone S 0 0 shade of gray to 1 0 pure color V 0 0 black to 1 0 white Based on C Code in Computer Graphics Principles and Practice Foley et al 1996 p 592 PROCEDURE RGBToHSV CONST R G B TReal VAR H S V TReal VAR Delta TReal Min TReal BEGIN Min MinValue R G B USES Math V MaxValue R G B Delta V Min Calculate saturation saturation is 0 if r g and b are all 0 IF V 0 0 THEN S 0 ELSE S Delta V IF S 0 0 THEN H NaN Achromatic When s 0 h is undefined ELSE BEGIN Chromatic IF R V THEN between yellow and magenta degrees H 60 0 G B Delta ELSE IF G V THEN between cyan and yellow H 120 0 60 0 B R Delta ELSE IF B V THEN between magenta and cyan H 240 0 60 0 R G Delta IF H 0 0 THEN H H 360 0 END END RGBtoHSV HSVtoRGB Based on C Code in Computer Graphics Principles and Practice Foley et al 1996 p 593 H 0 0 to 360 0 corresponding to 0 360 degrees around hexcone NaN undefined for S 0 S 0 0 shade

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/HSV.htm (2016-02-14)
    Open archived version from archive

  • efg's YUV Lab Reports
    a proper antenna He just dropped a cable out of the window which explains the interference that can be see in the V images above perhaps a good starting point to eliminate the interference with a FFT Conclusions Humans can discriminate spatial monochrome information better than spatial color information Hence more bits are used to store Y information since the human eye is more sensitive to changes in luminance than changes in hue or saturation which is communicated in the U and V components Keywords YUV RGB YVU 9 YV 12 Scanline TRGBTripleArray TFileStream Seek SaveToFile Files Delphi 3 4 5 Source Code and EXE with YUV9 Stream and YUV12 Stream files 319 KB YVUtoRGB ZIP Also see Links below UYVY to RGB Purpose The purpose of this program is to read a stream of UYVY bytes and convert the YUV values to RGB for display Materials and Equipment Software Requirements Windows 95 98 Delphi 3 4 5 to recompile UYVY EXE with input file UYVY Stream Hardware Requirements VGA or higher monitor in high color or true color display mode Procedure Double click on the UYVY EXE icon to start the program Click on the Read button to process the UYVY Stream file and display it on the screen If desired view the UYVY BMP file Discussion One common YUV format group is called the packed formats group where Y U and V samples are packed together into macropixels which are stored in a single array See the YVU 9 and YV 12 Lab Report above for a planar format example One of these packed formats is UYVY which is probably the most popular of the various YUV 4 2 2 formats Understanding the format of a digital video stream is essential in processing an image Determining the X and Y dimensions of an image in a file is the first step In this case I was given the size of each image CONST YUVwidth 386 YUVheight 320 Acutally the original image was 720 by 576 This example is a subset of the original Each row of data is an array of UYVY values where each Y U V value is a single byte The BufferYUV array contains the array of RECORDs TYPE TYUVWord A Word is always 2 bytes in all versions of Delphi RECORD UV BYTE U if index even V if index odd Y BYTE Y for all array elements END VAR BitmapRGB TBitmap BufferYUV ARRAY 0 YUVwidth 1 OF TYUVWord The rest of the program is relatively straigtforward TYPE TRGBTripleArray ARRAY 0 YUVwidth 1 OF TRGBTriple pRGBTripleArray TRGBTripleArray VAR BitmapRGB TBitmap i INTEGER j INTEGER Row pRGBTripleArray StreamYUV TFileStream U INTEGER V INTEGER Y INTEGER begin StreamYUV TFileStream Create UYVY Stream fmOpenRead TRY BitmapRGB TBitmap Create TRY BitmapRGB PixelFormat pf24Bit BitmapRGB Width YUVwidth BitmapRGB Height YUVheight FOR j 0 TO YUVheight 1 DO BEGIN StreamYUV Read BufferYUV SizeOf BufferYUV Row BitmapRGB Scanline j FOR i 0 TO YUVwidth 1 DO BEGIN IF i MOD 2 0 Even THEN BEGIN Y BufferYUV i Y U BufferYUV i UV V BufferYUV i 1 UV get V from next word END ELSE BEGIN Odd Y BufferYUV i Y U BufferYUV i 1 UV get U from last word V BufferYUV i UV END WITH Row i DO BEGIN See HELP YUV RGB conversion 12 12 97 by lweng analogic com for this formula rgbtRed FixValue 1 164 Y 16 1 596 V 128 rgbtGreen FixValue 1 164 Y 16 0 392 U 128 0 813 V 128 rgbtBlue FixValue 1 164 Y 16 2 017 U 128 END END END BitmapRGB SaveToFile UYVY BMP ImageYUV Picture Graphic BitmapRGB FINALLY BitmapRGB Free END FINALLY StreamYUV Free END end The FixValue function forces a floor of 0 and a ceiling of 255 on the R G B values FUNCTION FixValue CONST x DOUBLE BYTE VAR i INTEGER BEGIN i ROUND x IF i 255 THEN RESULT 255 ELSE IF i 0 THEN RESULT 0 ELSE RESULT BYTE i END FixValue Acknowledgement Thanks to Daniel Halan from Sweden for providing me this image and asking how it could be processed Conclusions A byte stream with UYVY values can be easily converted to RGB pixels for display Keywords YUV UYVY RGB TYUVWord TFileStream Scanline TRGBTripleArray Files Delphi 3 4 5 Source and EXE with UYVY Stream file 259 KB UYVY ZIP Also see Links below Y8 Gray Scale Purpose The purpose of this program is to read a stream of bytes and display the information as a gray scale image Both palette and non palette solutions are presented Materials and Equipment Software Requirements Windows 95 98 Delphi 3 4 5 to recompile DeutschGray EXE with input file Gray Stream Hardware Requirements VGA or higher monitor in high color or true color display mode Procedure Double click on the DeutschGray EXE icon to start the program Click on the left Read Image button to display a solution that produces a pf24bit BMP file Click on the right Read Image button to display a solution that uses palettes and produces a pf8bit BMP file Discussion Understanding the format of a digital video stream is essential in processing an image Determining the X and Y dimensions of an image in a file is the first step In this case I determined the the size of the image from information that was given me and by visually inspecting a hex dump of the image bytes CONST BildWidth 392 BildHeight 250 Actually this image is a small portion of the original image This is to reduce the size of the download file Creating a 256 shades of gray image using a pf24bit TBitmap for display in high color or true color mode is fairly straightforward Working with a pf24bit bitmap requires the use of a pRGBTripleArray to access each pixel in a scanline Row Read file and display as pf24bit bitmap avoid use of palettes procedure TForm1 ButtonGray1Click Sender TObject TYPE TRGBTripleArray ARRAY 0 BildWidth 1 OF

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/YUV.htm (2016-02-14)
    Open archived version from archive

  • efg's "Palette Lab " Lab Report
    display the image at the upper right Select the Gradient button Experiment with various types of gradient palettes by selecting the R G B checkboxes For example uncheck the G and B checkboxes With only a red gradient the reds in the parrot on the right appear quite good in the image at the lower right Experiment with how WM QueryNewPalette and WM PaletteChanged Windows messages are processed by running multiple versions of the program with different images selected and alternate between which application has focus Watch how palettes are realized in foreground and background Uncheck the button and see what happens when these messages are not processed The GetTickCount values allow one to study the order the messages are processed Discussion Processing the WM QueryNewPalette and WM PaletteChange messages is necessary if different windows receive focus The foreground image always looks best Sometimes the background images can suffer image quality but this is to ensure the foreground image is displayed correctly Palette Entry Flags 0 This is the most common setting for a normal color request to follow the standard rules of realization The palette manager checks to see if this color is already somewhere in the system palette If so and that color isn t PC RESERVED then this color is mapped to that entry If not then it s put in an unused entry If there are no unused entries then it is mapped to the closed entry currently in the system palette 1 PC Reserved For palette animation with AnimatePalette API call The palette manager tries to find an unused entry in the system palette If it finds one this color is mapped there and the entry is marked as unusable for color matching In other words the entry is reserved exclusively for this color If

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/PaletteLab.htm (2016-02-14)
    Open archived version from archive

  • efg's Palettes and Colors Lab Reports
    or GIF TColorDialog TOpenPictureDialog TSavePictureDialog TIniFile RGBTripleToHSV TBevel CombinePf4Bit Combine three pf4Bit Bitmaps with Different Palettes into a pf24Bit Bitmap or into a pf8Bi t Bitmap with a Combined Palette Scanline PixelFormat pf4bit pf8bit pf24bit Windows Palette TMaxLogPalette Canvas Draw pByteArray palPalEntry GetPaletteEntries GetColorTable IsPaletteDevice function GetDeviceCaps RASTERCAPS RC PALETTE Canvas Draw CycleColors Cycle through 18 000 colors with 24 bit Bitmap ScanLine IdleAction TRGBTriple FractInt Color Maps HSV Display Colors by Red Green Blue or Hue Saturation Value RGB HSV Color Space ArcTan2 TTrackBar CreateHSVGradient CreateRGBGradient CreateHueSaturationCircle IsPaletteDevice High Color True Color NaN IsNan IEEE754 MouseDown MouseMove ShellExecute pRGBTripleArray Scanline EColorError RGBtoHSV HSVtoRGB RGBtoRGBTriple HSVtoRGBTriple RGBTripleToHSV Maxwell Triangle Demonstrate the mixture of colored lights and introduce the concept of chromaticity coordinates Maxwell Triangle xyz Chromaticity Coordinates RGB Coordinates Bitmap Scanline Canvas MoveTo Canvas LineTo OnMouseMove Cramer s Rule MulDiv point in triangle algorithm PaletteLab Experiment with palettes in the Palette Lab Halftone Palette Gradient Palette Optimized Palette FractInt Color Maps RGBColors Show RGB Colors Display any of the 16 8 million RGB colors by using TrackBars to control the components of a color Colors may dither in 256 color mode See the 20 Windows colors that do not dither in 256 color mode RGB non dither system palette colors Color Depth Palette Device GetDeviceCaps Raster Capabilities ColorToString GetRValue GetGValue GetBValue ShowDemoMany Optimized Palette Demo Many Images Create an optimized palette for several images of the best 236 colors for display on a 256 color monitor Same as ShowDemoOne plus GetBitmap callback Procedure TComponentSet ShowDemoOne Optimized Palette Demo One Image Create an optimized palette for a single image of the best 236 colors for display on a 256 color monitor Palettes TOctreeNode class TColorQuantizer class Bitmap Palette Bitmap LoadFromFile ColorQuantizationLibrary unit PaletteLibrary unit TPaintBox CreateHalftonePalette API call Show Image Show

    Original URL path: http://www.efg2.com/Lab/Graphics/Colors/index.html (2016-02-14)
    Open archived version from archive

  • Smoothing algorithm using Bezier Curves
    0 results are B x P1 x and By P1 y When t 1 results are B x P4 x and By P4 y If one has NB1 points for the curve one needs a total of NB2 NB1 3 1 points because between each point P of the curve we have to build two control points named PC1 and PC2 The points of the curve and associated control points are stored in the BB array of Tpoints BB array 0 NB2 of Tpoints One can say that a P point of the curve which is not an end point has a prior left control point of P2 type and has a next right control point of P1 type The Bézier curve goes through the P1 and P4 points and the curve appearance depends on the two control points P2 and P3 To solve the curve smoothing problem we have to find a method for building the control points P2 and P3 First approach To smooth the Pn edges of the green polyline one can intuitively imagine that the smoothing curve should be tangent to a segment which is parallel to the segment Pn 3 Pn 3 It joins the prior and next points relative to the current point The above figure shows how to draw the PC1 control point located to the right of the curve point Pn S1a is the middle of the Pn S1 segment and PC1 is located on the segment S1a Pn 3 The length of the S1a PC1 segment is about 1 3 of the S1 Pn 3 segment length In brief The control points for the smoothing algorithm will be placed on the tangent line and their displacement from the curve point will control the curve appearance For each point of the curve 3 points are used the control point PC2 index n 1 used to build the tangent and to define the curve the P point of the curve index n with n mod 3 0 the control point PC1 index n 1 used to build the tangent and to define the curve The particular case of the end points n 0 and n NB2 offers 2 possibilities depending on whether the curve is closed or open When the curve is closed P 0 P NB one can execute the smoothing algorithm because the next and prior points are known When the curve is open P 0 has no prior PC2 point We shall consider that PC2 and P 0 are the same Idem for the PC1 conrol point of the last point P NB2 This method gives some good results with simple curves but doesn t work fine in all cases For example a hexagon is transformed into a potatoïd looks like a potato The next step will try find a more flexible solution For example the algorithm should be able to transform progressively a square to a circle Geometrical control points construction This geometrical solution is completely empirical but gives

    Original URL path: http://www.efg2.com/Lab/Graphics/Jean-YvesQueinecBezierCurves.htm (2016-02-14)
    Open archived version from archive



  •