PureBasic Forum
http://forums.purebasic.com/english/

Replace Colors with Range [Windows]
http://forums.purebasic.com/english/viewtopic.php?f=12&t=72962
Page 1 of 1

Author:  RASHAD [ Wed Jun 05, 2019 9:12 am ]
Post subject:  Replace Colors with Range [Windows]

Hi
Code:
UseJPEG2000ImageDecoder()
UseJPEG2000ImageEncoder()
UseJPEGImageDecoder()
UseJPEGImageEncoder()
UsePNGImageDecoder()
UsePNGImageEncoder()
UseTGAImageDecoder()
UseTIFFImageDecoder()

Global FileName$,SCRImage,DESImage,NEW_Image
Define omwheel.f , mWheel.f

Macro CopyImageToMemory(imagenumber, Memory)
   TemporaryBitmapInfo.BITMAPINFO
   TemporaryDC = CreateDC_("DISPLAY", #Null, #Null, #Null)
   GetObject_(ImageID(imagenumber), SizeOf(BITMAP), TemporaryBitmap.BITMAP)
   TemporaryBitmapInfo\bmiHeader\biSize        = SizeOf(BITMAPINFOHEADER)
   TemporaryBitmapInfo\bmiHeader\biWidth       = TemporaryBitmap\bmWidth
   TemporaryBitmapInfo\bmiHeader\biHeight      = -TemporaryBitmap\bmHeight
   TemporaryBitmapInfo\bmiHeader\biPlanes      = 1
   TemporaryBitmapInfo\bmiHeader\biBitCount    = 32
   TemporaryBitmapInfo\bmiHeader\biCompression = #BI_RGB
   GetDIBits_(TemporaryDC, ImageID(imagenumber), 0, TemporaryBitmap\bmHeight, Memory, TemporaryBitmapInfo.BITMAPINFO, #DIB_RGB_COLORS)
   DeleteDC_(TemporaryDC)
EndMacro

Macro CopyMemoryToImage(Memory, imagenumber)
   TemporaryBitmapInfo.BITMAPINFO
   TemporaryDC = CreateDC_("DISPLAY", #Null, #Null, #Null)
   GetObject_(ImageID(imagenumber), SizeOf(BITMAP), TemporaryBitmap.BITMAP)
   TemporaryBitmapInfo\bmiHeader\biSize        = SizeOf(BITMAPINFOHEADER)
   TemporaryBitmapInfo\bmiHeader\biWidth       = TemporaryBitmap\bmWidth
   TemporaryBitmapInfo\bmiHeader\biHeight      = -TemporaryBitmap\bmHeight
   TemporaryBitmapInfo\bmiHeader\biPlanes      = 1
   TemporaryBitmapInfo\bmiHeader\biBitCount    = 32
   TemporaryBitmapInfo\bmiHeader\biCompression = #BI_RGB
   SetDIBits_(TemporaryDC, ImageID(imagenumber), 0, TemporaryBitmap\bmHeight, Memory, TemporaryBitmapInfo.BITMAPINFO, #DIB_RGB_COLORS)
   DeleteDC_(TemporaryDC)
EndMacro

Procedure min(n1,min)
  !MOV Eax,dword[p.v_n1]
  !MOV Ecx,dword[p.v_min]
  !CMP Ecx,Eax
  !cmovg Eax,Ecx
  ProcedureReturn
EndProcedure

Procedure Max(n1,max)
  !MOV Eax,dword[p.v_n1]
  !MOV Ecx,dword[p.v_max]
  !CMP Eax,Ecx
  !cmovg Eax,Ecx
   ProcedureReturn
EndProcedure

Procedure ReplaceColors (DESImage,SCRImage, Range ,Scolor, Tcolor)
   Protected TemporaryBitmapInfo.BITMAPINFO, TemporaryBitmap.BITMAP ,PicDestDC.l,PicSrcDC.l ,BitCount ,Width,Height,LineWidth =0
   Define.l TemporaryDC   
   
   Width = ImageWidth(SCRImage)
   Height = ImageHeight(SCRImage)
   LineWidth = Width * 4
   
   ResizeImage(DESImage,Width,Height)
   
   BitCount = LineWidth * Height
   Dim Bits.a (BitCount)
   CopyImageToMemory(SCRImage, @Bits())
   
   #COLOR_PERCENTAGE = 2.55
   
   Define.l SelectR = (Scolor & $000000FF),SelectG = (Scolor & $0000FF00) >> 8,SelectB = (Scolor & $00FF0000) >> 16
   Define.l SubsR = (Tcolor & $000000FF),SubsG = (Tcolor & $0000FF00) >> 8,SubsB = (Tcolor & $00FF0000) >> 16
   Define.l TempVar, RangeMinR, RangeMinG, RangeMinB
   Define.l RangeMaxR, RangeMaxG, RangeMaxB, i ,h ,w
   
   TempVar = Int(SelectR - ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMinR = min(TempVar , 0)
   TempVar = Int(SelectG - ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMinG = min(TempVar , 0)
   TempVar = Int(SelectB - ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMinB = min(TempVar , 0)
   TempVar = Int(SelectR + ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMaxR = max(TempVar , 255)
   TempVar = Int(SelectG + ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMaxG = max(TempVar , 255)
   TempVar = Int(SelectB + ((Range / 2) * #COLOR_PERCENTAGE))
   RangeMaxB = max(TempVar , 255)   
   
   For  h = 0 To Height-1
      For w = 0 To Width-1
         i = h * LineWidth + 4 * w
         If (((Bits(i+2) >= RangeMinR) And (Bits(i+2) <= RangeMaxR)) And ((Bits(i+1) >= RangeMinG) And (Bits(i+1) <= RangeMaxG)) And ((Bits( i ) >= RangeMinB) And (Bits( i ) <= RangeMaxB)))
            Bits(i+2) = SubsR
            Bits(i+1) = SubsG
            Bits( i ) = SubsB
         EndIf
      Next
   Next   
   CopyMemoryToImage(@Bits(), DESImage)
EndProcedure

Procedure WindowProc(hWnd,uMsg,wParam,lParam)
  Result = #PB_ProcessPureBasicEvents
  Select uMsg               
     
    Case #WM_NCACTIVATE
      If wParam = 0
        ProcedureReturn 1
      EndIf
       
    Case #WM_SIZE
      ResizeGadget(10,0,44,WindowWidth(0),WindowHeight(0)- 44)       
      StartDrawing(CanvasOutput(10))
        Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
        If IsImage(NEW_Image)
          DrawImage(ImageID(NEW_Image),GadgetWidth(10)/2-ImageWidth(NEW_Image)/2,GadgetHeight(10)/2-ImageHeight(NEW_Image)/2)
        EndIf
      StopDrawing()     

  EndSelect
  ProcedureReturn Result
EndProcedure

CreateImage(10,24,24,24,$FDFD98)
CreateImage(20,21,21,24,$FDFD98)

CatchImage(0,?open)
ResizeImage(0,20,20)
CatchImage(4,?Replace32)
ResizeImage(4,24,24)
CatchImage(6,?save)
ResizeImage(6,22,22)
CatchImage(7,?Print)
ResizeImage(7,32,32)

LoadFont(0,"Consolas",12)
OpenWindow(0,0,0,800,600,"Replace Colors",#PB_Window_SystemMenu|#PB_Window_ScreenCentered| #PB_Window_MaximizeGadget| #PB_Window_SizeGadget)
SetWindowColor(0,$E6E6E6)
WindowBounds(0,480,400,#PB_Default,#PB_Default)

ButtonImageGadget(0,10,6,32,32,ImageID(0))
GadgetToolTip(0,"Load Image")
FrameGadget(20,50,10,23,23,"",#PB_Frame_Flat)
ImageGadget(1,51,11,23,23,ImageID(20))
GadgetToolTip(1,"Source Color")
SetGadgetColor(1,#PB_Gadget_BackColor,$FFFFFF)
ButtonImageGadget(2,78,8,27,27,ImageID(10))
GadgetToolTip(2,"Target Color")
SpinGadget(3,112,10,58,24,0,100,#PB_Spin_Numeric)
SetGadgetFont(3,FontID(0))
GadgetToolTip(3,"Colors Range %")
SetGadgetState(3,30)
ButtonImageGadget(4,176,6,36,32,ImageID(4))
GadgetToolTip(4,"Replace Colors")
ButtonImageGadget(6,240,6,32,32,ImageID(6))
GadgetToolTip(6,"Save As")
ButtonImageGadget(7,275,6,32,32,ImageID(7))
GadgetToolTip(7,"Print Image")
CanvasGadget(10,0,44,800,556,#PB_Canvas_Border)
StartDrawing(CanvasOutput(10))
  Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
StopDrawing()

SetActiveWindow(0)
SetWindowCallback(@WindowProc(),0)   
hdc = GetDC_(0)

Repeat           
  Select WaitWindowEvent()
 
      Case #PB_Event_CloseWindow
        Quit = 1
           
      Case #WM_KEYDOWN
        If load = 1
          If omwheel.f < -8
            omwheel.f = -8
          EndIf
          If EventwParam() = 40
            mWheel = omwheel - 1
          ElseIf EventwParam() = 38
            mWheel = omwheel + 1
          EndIf
          omwheel = mWheel
          mWheel = 1+mwheel/10
          If Replace = 1
            CopyImage(DESImage,NEW_Image)
            ResizeImage(NEW_Image,ImageWidth(DESImage)*mWheel ,ImageHeight(DESImage)*mWheel)
          Else
            CopyImage(SCRImage,NEW_Image)
            ResizeImage(NEW_Image,ImageWidth(SCRImage)*mWheel ,ImageHeight(SCRImage)*mWheel)
          EndIf
          StartDrawing(CanvasOutput(10))
            Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
            DrawAlphaImage(ImageID(NEW_Image),GadgetWidth(10)/2-ImageWidth(NEW_Image)/2,GadgetHeight(10)/2-ImageHeight(NEW_Image)/2)
          StopDrawing()
        Else
          MessageRequester("Error","No Loaded Image ...",#PB_MessageRequester_Ok|#MB_ICONERROR)
        EndIf
         
      Case #PB_Event_Gadget
          Select EventGadget()
            Case 0
              FileName$ = OpenFileRequester("SELECT IMAGE","","All supported formats|*.bmp; *.png; *.jpg; *.tif; *.tiff;|TIF image (*.tif)| *.tif| TIFF image (*.tiff)| *.tiff| PNG image (*.png)| *.png| BMP image (*.bmp)| *.bmp| JPGimage (*.jpg)| *.jpg",0)                 
              If FileSize(FileName$) >= 0
                load = 1 : down = 0 :Replace = 0
                SCRImage = LoadImage(#PB_Any,FileName$)
                CopyImage(SCRImage,NEW_Image)
                DESImage = CreateImage(#PB_Any,ImageWidth(NEW_Image),ImageHeight(NEW_Image),24,$FFFFFF)
                StartDrawing(CanvasOutput(10))
                  Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
                  DrawImage(ImageID(NEW_Image),GadgetWidth(10)/2-ImageWidth(NEW_Image)/2,GadgetHeight(10)/2-ImageHeight(NEW_Image)/2)
                StopDrawing()
              EndIf
             
            Case 2
              Tcolor = ColorRequester(0)
              CreateImage(1,24,24,24,Tcolor)
              SetGadgetAttribute(2,#PB_Button_Image,ImageID(1))
             
            Case 4
              If Tcolor >= 0
                ReplaceColors(DESImage,NEW_Image, GetGadgetState(3) ,Scolor,Tcolor)
                CopyImage(DESImage,NEW_Image)
                LockWindowUpdate_(WindowID(0))
                StartDrawing(CanvasOutput(10))
                  Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
                  DrawImage(ImageID(NEW_Image),GadgetWidth(10)/2-ImageWidth(NEW_Image)/2,GadgetHeight(10)/2-ImageHeight(NEW_Image)/2)
                StopDrawing()                   
                LockWindowUpdate_(0)
                down = 0 : Replace = 1
              Else
                MessageRequester("Error","Please Select Target Color First",#MB_OK|#MB_ICONERROR)
              EndIf
             
            Case 6 ;Save Image
              If IsImage(NEW_Image)
                FileName$ = SaveFileRequester("Save as","","Image Formats|*.bmp;*.png;*.jpg|PNG image (*.png)|*.png|BMP image (*.bmp)|*.bmp|JPGimage (*.jpg)|*.jpg",0)
                  Pattern = SelectedFilePattern()
                  If FileName$ And Pattern <> -1                 
                    Select Pattern                       
                      Case 1
                        SaveImage(NEW_Image, Filename$ + ".png" ,#PB_ImagePlugin_PNG)                       
                      Case 2
                        SaveImage(NEW_Image, Filename$ + ".bmp" ,#PB_ImagePlugin_BMP)                       
                      Case 3
                        SaveImage(NEW_Image, Filename$ + ".jpg" ,#PB_ImagePlugin_JPEG)                       
                  EndSelect                 
                Else
                  MessageRequester("Information", "No file name to save",#MB_OK)           
                EndIf
              Else
                MessageRequester("Error","No Target Image to Save",#MB_OK|#MB_ICONERROR)
              EndIf             
             
            Case 7 ;Print Image
              Select EventType()
                Case #PB_EventType_LeftClick
                  Beep_(800,100)
                  If IsImage(NEW_Image)   
                    If PrintRequester()
                      If StartPrinting("PureBasic Test")               
                        If StartDrawing(PrinterOutput())
                            DrawAlphaImage(ImageID(NEW_Image), 0, 0)                 
                          StopDrawing()
                        EndIf             
                        StopPrinting()
                      EndIf
                    EndIf
                  Else
                    MessageRequester("Attention","No Target Image to Print",#PB_MessageRequester_Ok| #MB_ICONQUESTION)
                  EndIf
              EndSelect             
           
            Case 10
              Select EventType()               
                Case  #PB_EventType_MouseMove
                    If load = 1 And down = 0
                      GetCursorPos_(p.POINT)                           
                      color = GetPixel_(hdc,p\x,p\y)
                      StartDrawing(ImageOutput(20))
                        Box(0,0,22,22,color)
                      StopDrawing()
                      SetGadgetState(1,ImageID(20))
                    EndIf
                   
                Case  #PB_EventType_MouseWheel
                  If load = 1
                    If omwheel.f < -8
                      omwheel.f = -8
                    EndIf
                    value = GetGadgetAttribute(10,#PB_Canvas_WheelDelta )
                    mwheel.f = omwheel + value
                    omwheel = mWheel
                    mWheel = 1+mwheel/10
                    If Replace = 1
                      CopyImage(DESImage,NEW_Image)
                      ResizeImage(NEW_Image,ImageWidth(DESImage)*mWheel ,ImageHeight(DESImage)*mWheel)
                    Else
                      CopyImage(SCRImage,NEW_Image)
                      ResizeImage(NEW_Image,ImageWidth(SCRImage)*mWheel ,ImageHeight(SCRImage)*mWheel)
                    EndIf
                    StartDrawing(CanvasOutput(10))
                      Box(0,0,GadgetWidth(10),GadgetHeight(10),$E6E6E6)
                      DrawAlphaImage(ImageID(NEW_Image),GadgetWidth(10)/2-ImageWidth(NEW_Image)/2,GadgetHeight(10)/2-ImageHeight(NEW_Image)/2)
                    StopDrawing()
                  Else
                    MessageRequester("Error","No Loaded Image ...",#PB_MessageRequester_Ok|#MB_ICONERROR)
                  EndIf
                   
                Case  #PB_EventType_LeftClick
                    If load = 1
                      Beep_(800,100)
                      down = 1
                      Scolor = color
                     EndIf               

              EndSelect           
          EndSelect
         
  EndSelect
Until Quit = 1
End

DataSection
Open:
   Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$4D41670400000061
   Data.q $8A0537C8AF000041,$58457419000000E9,$72617774666F5374,$2065626F64410065,$6165526567616D49
   Data.q $00003C65C9717964,$1918544144494202,$001865558B41C105,$61DCEF77CEFDE7E0,$D98D4B51894DD468
   Data.q $368B5569B846508B,$3689FD155A42D041,$84FD0564DD3EE091,$9B5042516444595C,$A8E24E23A169B108
   Data.q $7BE73DCF7BDCCCE3,$ED7000004CC89E7B,$E06861830E5CC3E6,$8BFB1968A3A3CEF6,$BDFA6F8BBBDDDEE1
   Data.q $991E7B7D5D3FCBBD,$3F3F70FCAE000009,$32D02683C3CA70BC,$13DBFD7C76A6C6AD,$9DBDC1F6F9DADFBF
   Data.q $C7A638C000002AF7,$0D5A4A54C3CEE947,$E775E9C6F07CFECD,$FF5D6F2D31B71CCF,$E890000002B3E0EE
   Data.q $66176985DA655982,$704E677327BFE2D3,$0B8FB5D31B31DCF1,$41A8E93044000000,$E6E17BDB16ACC2ED
   Data.q $DEA2D49A79D3D2F6,$56D6E6D98FF67EBE,$2BA10A9F4A400144,$1289D6B25AD48805,$9795E591A893AEBA
   Data.q $0892120889397FCE,$4C174D0840D7DC6E,$9321110B5A99116B,$5C1F2DAFD685C86A,$7E73C453651DF631
   Data.q $16A8BFAF8BB2F5BC,$6530D282E92D144A,$BD6C9455AA9992BD,$F67FB70E96CA9FB1,$17EECE3A5D3FEFF4
   Data.q $1F68661D0E811204,$730DACE4550B42FC,$D5B476F6AC77DBFB,$D91F5BABEFB389C2,$14A4CA401664E8DC
   Data.q $5A2070E59CFCF9FE,$BC9DE7F5D4556A89,$F07A39A94C8D0970,$148416642919FE95,$1CB5365A606BE6EA
   Data.q $7BBF42E399956AFA,$B03F45E70E68090D,$5F307E8B461AB15C,$9FBBC558F0BF8EF6,$2D5EB2636C7BBAFC
   Data.q $656D1A264081B665,$ED05C72974C56D73,$D4ECD4F0E5F71B50,$849EAFCB8DC5FE9B,$F648E499230CCFAA
   Data.q $1E3973990B692DB2,$867C72FB0E40F1C9,$8F470EADF66A0006,$A13993B2164261B4,$44F664AE41B6C9AD
   Data.q $B9A800058B8C194F,$12D39DF57DB5FE58,$B4F7C44800000001,$293C21693FF00DBC,$00000000D6A829D5
   Data.q $826042AE444E4549
Openend:

Save:
   Data.q $0A1A0A0D474E5089,$524448490D000000,$1000000010000000,$FFF31F0000000608,$4D41670400000061
   Data.q $8A0537C8AF000041,$58457419000000E9,$72617774666F5374,$2065626F64410065,$6165526567616D49
   Data.q $00003C65C9717964,$191854414449FE01,$0618555D8B3DC105,$9282433BECCFB5D0,$560A0344448460A8
   Data.q $827F15A3F1206501,$A522D0422A916885,$A16308A222565636,$2295616282760AD8,$12B442C54EC11616
   Data.q $1F7EF67B99DE0CC5,$1E16F77C6F876AD7,$268E91F70278F3C3,$2A94934B2CD2DEC0,$DF5D3DBCFC6FECFF
   Data.q $7D3C765FCBF1F3BB,$1E2EA79A75DAEB74,$DECB5BB11BB15208,$B6F1C6B458399CD2,$7C79FEBF73CC9F1C
   Data.q $C6F0E4F97E6FF3E5,$E7757C20BC16E7D7,$AA0FE1F9B892155F,$37669659BD366B42,$D7F4B4DA5196BB62
   Data.q $8FFD8399D0FCBA5E,$3ACA3AC554123C16,$5537A6C7BE8AD602,$77F7C4847595DDB1,$FD8E9ED9ECDFD9EF
   Data.q $2C0AEED882A3B38E,$6B2734D17D3611AD,$8FE2542A25469ED9,$12267D275A484EBF,$E9B15FAFDBC0474E
   Data.q $8CB4EFF8CEB0BE8B,$A4A63ACAA444552A,$8FD9FBBC489AB474,$461A2FA6C6966B5A,$41FE7F38002518C5
   Data.q $9AA94A85D123D8EB,$510213469170BE1E,$35A2AA895124AAA1,$D0092730E9483AEB,$448244124551A012
   Data.q $1874A49B5D65244B,$A4491234D11010B3,$9CA22A535512444A,$E77842B313A521AE,$D6E0000000004B95
   Data.q $35A5F4A488C64FD1,$0075F6E0F84888B3,$873991EAF3700000,$700D1551AE8908DD,$6A00000000ABD2ED
   Data.q $34ACC927A506B996,$00000005FEFF6E02,$33AD39CD17D1F678,$F8F51BB6FC57A492,$FB9F378D6ACF9733
   Data.q $CBFB85C000000014,$DF6F8DE1DBBF819C,$9280792AB924F24F,$89148A4948A49484,$3FFBB96D3DC84824
   Data.q $A2B0106D8B6E7C21,$444E454900000000,$826042AE
Saveend:

Replace:
   Data.q $0A1A0A0D474E5089,$524448490D000000,$1400000014000000,$8AEB020000000208,$414449D10100005A
   Data.q $600140F863CB3854,$1FE6A48F0B9A0618,$3E27B5989FDDCE4A,$8DA4A8D6CA4C477D,$ADD4F75B129B5911
   Data.q $34F8BBF3DEF2B73D,$FAD97B70DE4C1FE7,$C6FABC5CDED6CB5B,$673ABD2FE7D715A2,$B78B9B473D2985EE
   Data.q $24FB753AAE6E3764,$5ADDD712FB39CD4E,$2E163755A2C6E6BA,$9995D173A80F36BF,$E667B67A9F4D2FF3
   Data.q $96D6AA8A3B5589F9,$5DCCE6BB1B7279DD,$C4473793A2DB6971,$CCB11415598D0BAF,$09F4C6FE4FA1743F
   Data.q $BA749DE99EA63A27,$49F383A2CC69793B,$09CCC4277B29B008,$64A6A47AD8DC38ED,$BB42D24CBCDE6E73
   Data.q $23B6E4EAD677477F,$701D9B5C2AFB8D75,$0B53B2EDEEF77E6A,$48ADA674B77B04D1,$B1D4A7BD55543A68
   Data.q $F2BBFB09E6A716CE,$F4E96CF48B23A4D6,$37B6525DDAAAF5EF,$EC2494CA5275633F,$2D31B7949E1FA79A
   Data.q $7EB72714D7B26D6B,$C88B56FB6B2EA77B,$560EEB8ABB95C1B9,$7339E89BF32FECD4,$9E9D1CE79A2C74EB
   Data.q $A709AEA9D27521BB,$6E6B1D75B44F7B3A,$50F1B6B872D0DA3F,$31A57DEA9CEEF155,$707CDCA726D2220B
   Data.q $AE666647B9E68B03,$B5BC7DDAD13DEC49,$550E9A78301358E3,$B29059DF28AC1C37,$E4A4DA47A277CE22
   Data.q $7713244CE20E1743,$6E185D8C892E26F5,$695A6C6B59666CDB,$3C9D6D576BA25460,$6276C8E996C66131
   Data.q $C353310DF596B00F,$B99DBDDF6F55CCC9,$64D500CFCFA0DA73,$000088E5AA40D2D2,$42AE444E45490000
   Data.q $8260
Replaceend:

Print:
   Data.q $0A1A0A0D474E5089,$524448490D000000,$6C0000006C000000,$4A487D0000000304,$544C5030000000FE
   Data.q $6F5A56563E3A3A45,$B0A3928F89827775,$C7BBC0BCBAAEADAA,$EAE6E6DCCFCCC3C9,$FBFBF781F980F3F3
   Data.q $FF8080FF8080FF80,$000000A0BD44D980,$FFFFFF534E527410,$FFFFFFFFFFFFFFFF,$949FCD000000FFFF
   Data.q $4144494601000086,$C54ABDD8EDC35854,$59AAE208F1C01430,$803CC9C104112CEE,$41E01FB321159C4B
   Data.q $9B3D2745C4493BA7,$2F8B304DC5C42A28,$045BF187C0728821,$27115EDAE5AF6A4D,$6872DF9A153FE4F5
   Data.q $996644A3FAF1529A,$E10BBAE888F55665,$742AE88E707B378C,$ECF6043D6E70013A,$61A2E896B03A77D2
   Data.q $DF6C9491C5967F9C,$18FD3842CF669A74,$2F63F06DCE0851E7,$0A347AA8B05B8844,$0873D88CD74488CB
   Data.q $BA27AD294F7E2B00,$8043F98D4AD688C5,$B627DE4F6071DB6A,$7D7BC4A654B1652B,$CC7F7AD64B05BAE9
   Data.q $A10A6E1AEFA71588,$0EE2189037A8B0D4,$10BCDBF6900F7623,$A002B4C1B0350E52,$3358710B59DD88CD
   Data.q $D8D94CDFA213D589,$76AB738C6B76231C,$AC72B7A5EA82BD36,$F6416374B099C23A,$2C8D2B87C58FC5A8
   Data.q $3B6E20C6E744519E,$AD38A89C6A57AC57,$BB2B3F7F267C6EB4,$2FCBF27AD21A9AD1,$1AAE7E81CACCFFBC
   Data.q $D99664EA7F963F21,$77770C0F21037A77,$4900000000F5296E,$826042AE444E45
Printend:

replace32:
   Data.q $0A1A0A0D474E5089,$524448490D000000,$2000000020000000,$7A7A730000000608,$4D416704000000F4
   Data.q $61FC0B8FB1000041,$5948700900000005,$0E0000C20E000073,$0000804A281501C2,$6F53745845741900
   Data.q $7000657261777466,$74656E2E746E6961,$F131322E302E3420,$49A6040000956920,$DF96BD4758544144
   Data.q $E31FC1C714551B53,$7C03FD1D47550FA8,$7D1C6719C727C9F0,$A383E6FAB1F19C74,$3B45696C5A4D9268
   Data.q $C21376629D330A13,$1009364DDD9212AF,$14840D2008121020,$4530B4D82B423F28,$19D8ED6AA6B68EDB
   Data.q $84DD9673C7A8E0FB,$66733BE01901F9B0,$39EF7BE7EEF737B3,$FF3AED46EC56EEF7,$B24118E6E84656B3
   Data.q $9C4E0F9A519F111D,$EC4260FAB70DA841,$4709881C2C20D602,$B389BC275671E395,$03D2F8E898835866
   Data.q $1347DA5261FA5777,$0C46580FF9E8B504,$7D784B08CB3EE421,$1C197FA441086CE8,$30F118E099FED2B5
   Data.q $FC31CE36CE26F6CE,$76FA5C39F3B55C47,$3DDAD2E1A4AE2F82,$6A08131FD95A1D18,$6CDADED0B1570344
   Data.q $C6AE15BAD3344A81,$B61077C418B09B9E,$B4AA694871CAB67E,$6098BEF83E734230,$DCA8DDC19C57C2F5
   Data.q $8D5C18A9BE185856,$C98507B1343BE868,$1CB2988339B7F8E9,$2F813B7034C69E93,$D830D3973307BB5F
   Data.q $CDDAB02607B9854B,$E18EE0E61C777C58,$95130BD8E45FE589,$C006D5B7825602B8,$AE2C3DF22C6146CD
   Data.q $F9A06611EF082DDE,$9DE7D0FC6A5A1FB8,$BE06B3B56004DF2F,$FA993CCF2830D9C5,$A144B6E0ABC3460D
   Data.q $1C471E8E940BDAA9,$CE0D626C412FFB86,$34E0CBC14308FF4F,$FC78394EC9F3F009,$7B2E04CF2D5E8D1D
   Data.q $CCD2DE2E661DE61B,$21D6C58857E57936,$44E80996BE00B5D4,$D812A3B642B8AD33,$4E63858451B34C70
   Data.q $EEDCF70105C2FF18,$BC61E90F9E32C1D3,$77ED7CB611160C75,$F0F39ADF6A0A098D,$E89FAFACE0740AE0
   Data.q $91C300A30E8C0D84,$B1D0CB0207FF992B,$17FB740EDC781313,$BAF391F426E66460,$E5D1A9C16E781E60
   Data.q $B3880A69412BC84C,$DECE8C0EF278F699,$F4B8136942DF6E82,$02EBAF0193040163,$4B730758F38F3084
   Data.q $48961026B99DE53F,$63428F3D3855EF66,$0A13E8C6EDE71182,$0CC91338E350365E,$6CCF41083F5738A0
   Data.q $435706DE98B6F869,$F404835213469135,$24F03AA068F05576,$A0333C69BE45CD2E,$91A0F873630927A7
   Data.q $8F6D85E5AD8E8C14,$60B406D4C88A7042,$2566F4DFE28D5AE1,$C3F285E514DF82A6,$8EC1D6268626B2DB
   Data.q $782940DA5E3A3C7B,$CD99D4C6782D9E1B,$5C4C72AD48298F53,$FE2880DC9E1C1CD8,$B28DC4F9C24FB5F6
   Data.q $2F4E11F9B819EDE0,$04C655A90557467C,$E36710ED04D5496E,$CF4E1B2EDE2D4C08,$ABA1ACE9D784E8B6
   Data.q $098B6B84D5242B0C,$5940DD7DF708608A,$3711D71E761E1270,$AE561534ADDE02EE,$6C84AEBD43F21B89
   Data.q $DE28F0261B74BE22,$146738DFE7A6DC0D,$FC49BB41F69F4DFF,$ACB82632902AE4A7,$AA05B6DC8F4A0A09
   Data.q $AD4FBC79ED383E46,$95D03F0683C2F29E,$189ACA4282CE73EE,$1815C6189AA098CD,$AB570395344F17A4
   Data.q $4375F0338B2E195D,$CFC7BA0D5C323DC7,$B04C65714BA57ABF,$74D7B075D8E11359,$9F2DC18B1DBE2F41
   Data.q $D3E95FE28DDA2F4B,$0F88CEC2A5053859,$69716BA505FE46ED,$9CEA5C100AD0604C,$C709381A7D53D686
   Data.q $D842357B36DE127C,$4B4B5D2B1F819F8E,$07FC48846FC4E135,$3E56B68124081E19,$949D8EBE31BF0938
   Data.q $7738E1213F181AF2,$7BD55B3A6775D2AD,$B347FE037C416108,$526F3D380F3C9AB6,$56F7DE146AC8D6FE
   Data.q $6EA3C4313FF035BB,$F4EEEBA53DE983C0,$CCD7A463897C5E8D,$3DEABCA694A78E55,$9C5BF25B1628FBDC
   Data.q $1D781FF84DFAFDED,$8A9E8B671422A1A9,$21E32F1DA7EB257B,$A0D5C1E089356B14,$F3FF2AD94784282F
   Data.q $9579E74D9183974A,$9457849936EF8A33,$13E7E1FFC5455426,$000000A0A30321D0,$6042AE444E454900
   Data.q $82
replace32end:

EndDataSection

Author:  Kwai chang caine [ Wed Jun 05, 2019 11:45 am ]
Post subject:  Re: Replace Colors with Range [Windows]

Hello RASHAD :D
The source color is not selectable, but i suppose it's normal :wink:
And in the first load, i must select the image before click the button, else no effect :|
Other great job, like usually
Thanks to sharing 8)

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/