News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Fast median algorithm

Started by guga, July 18, 2020, 02:22:35 AM

Previous topic - Next topic

guga

Quote from: hutch-- on August 06, 2020, 12:29:17 PM
Hi Guga,

I think I understand what you are doing and an edge detection algo is a lot more useful than just removing water marks, it can also be used for both smoothing rough images or sharpening slightly blurry ones. What I suggested originally was a technique that I have been using for years, close proximity cloning to get the field depth correct and match the texture where possible.



The original on the left, the modified on the right. I used some Russian software to remove the buttons and manually cloned the background to get rid of the insignia. My comment is you can do both as both techniques have their advantages and between them the watermarks you want to remove can be filled in with a texture that maintains the correct field depth.

Very, very good !


The buttons you removed with which software ? You told is a russian, but, what is it ? It seems that what it does is paint over the good areas. If it is this what it´s doing, i´ use a program called inpaint that does a similar thing.


I saw some awesome program that can restore old movies near perfection. It´s called Viva Film Restoration. Unfortunatelly, it uses Cuda, so i can´t be able to give a try.

Take a look on what it does. It´s amazing. Too bad it uses only cuda  :sad:

https://www.youtube.com/watch?v=_LBnlhJTDrE

Sure, that if we ever succeed to make this algorithm works (even though google designed it only to watermark removal), a simple adaptation can make it work wonders specially because what those other apps does (basically) is calculate the area of the edges where they want things to be removed or cleaned. The main problem i see on such apps is that they uses (in general) huge libraries such as opencv (or cuda, in this case) that are absolutely unnecessary if could simply rebuild the same functions from scratch and improve them to produce the very same result (or even better).

There are other apps  (an old one), such as Diamond Film restoration and PFClean  that also do a good job. The main problem of diamond and PFClean is that it is not perfect and it is sloooowww. :greensml: :greensml: :greensml:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

hutch--

Hi Guga,

The app is called "Movavi Photo Editor 6". It does exactly what I did not need, tweaking pretty girls to look better but its fun to play with. I did the cloning with my very old and now buggy MicroGrafx Picture Publisher as it has exactly the right tools for doing this.

My suggestion was once you get the edge detection algo up and going, try sampling close to the watermark area to get the texture and field depth then selectively clone small parts to get rid of any blurring. I have seen robot watermark removal and some of it is real junk, a blurred mess that stands out very badly due to no compatibility of field depth.

hutch--

Something I should add, in reverse of normal video restoration, I have occasionally tried to make modern video look like old very slow frame rate film and while I have software that can add scratches, vignette and convert to either monochrome or sepia at 8 frames a second, its very hard to get it right. Hard to add in the flicker.

guga

Quote from: hutch-- on August 06, 2020, 03:08:26 PM
Hi Guga,

The app is called "Movavi Photo Editor 6". It does exactly what I did not need, tweaking pretty girls to look better but its fun to play with. I did the cloning with my very old and now buggy MicroGrafx Picture Publisher as it has exactly the right tools for doing this.

My suggestion was once you get the edge detection algo up and going, try sampling close to the watermark area to get the texture and field depth then selectively clone small parts to get rid of any blurring. I have seen robot watermark removal and some of it is real junk, a blurred mess that stands out very badly due to no compatibility of field depth.

Indeed. Sampling closer to the edge seems to be the way to go. The python version seems to do that using a technique called "Poisson reconstruction" that seems to do this. I tried Movavi once, but i quit. :greensml: :greensml: :greensml: personally i´m used to PaintShop pro for image edition, irfanview when i need to decrease the size without quality loss and Inpaint when i need to reconstruct some areas.

For video, i´m used to Sony vegas, plus VirtualDub and now, i´m trying to learn this huge ffmpeg  :greensml: :greensml:

If you want to make modern video looks like old, there´s a good forum where people teach doing this using avisynth (forum video help)

The guys there do a great job in video processing. Take a look a this example. (It´s for restoring old movies, not the opposite, but seems good, although i didn´t tested yet)
https://forum.videohelp.com/threads/369010-FILM9-Restoration-software-for-old-films-%288mm-Super8-16mm%29-and-video?
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

hutch--

 :biggrin:

> irfanview when i need to decrease the size without quality loss

I could lead you astray here, my JpgTool complete with sauce (whoops I mean source) does that just fine. With input from Marinus and Vortex the GDI+ code works really well.

guga

Quote from: hutch-- on August 06, 2020, 07:15:34 PM
:biggrin:

> irfanview when i need to decrease the size without quality loss

I could lead you astray here, my JpgTool complete with sauce (whoops I mean source) does that just fine. With input from Marinus and Vortex the GDI+ code works really well.
Wow. Tks you, steve

If you can, please release the source, i[ll like to see how to work with gditools to open image files and grab the pixels data.
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

Siekmanski

#171
Hi guga,

At your service,

Bare Minimum GDIplus code to save different Image Types and PixelFormat conversions:

http://masm32.com/board/index.php?topic=8483.msg92918#msg92918

You can skip "GdipCloneImage" in the sources, it's only used to process the same image over and over again.


Here is a routine to load a bitmap image to memory forced to 32bit ARGB pixels.
Now you have access to the raw ARGB pixels.  :cool:
No matter the format of the original bitmap image.


BitmapData struct                         
    dwWidth      dd ?   
    dwHeight     dd ?   
    Stride       dd ?   
    PixelFormat  dd ?   
    Scan0        dd ?   
    Reserved     dd ?
BitmapData ends

.data?
align 4
GDIplusBitmapData BitmapData <?>

.data
align 4
SourceBitmapData    dd NULL

.code
align 4
ReleaseBitmapMemory proc mem_ptr:DWORD

    .if mem_ptr != NULL
        invoke  VirtualFree,mem_ptr,0,MEM_RELEASE
        mov     mem_ptr,NULL
    .else
        mov     eax,1
    .endif
    ret
ReleaseBitmapMemory endp


align 4
LoadBitmapData proc uses ebx esi edi ImageName:DWORD,pImageData:DWORD

    mov         ReturnMessage,E_FAIL

    invoke      MultiByteToWideChar,CP_ACP,0,ImageName,-1,offset FilenameW,MAX_PATH-1
    invoke      GdipCreateBitmapFromFile,offset FilenameW,offset pImage
    test        eax,eax
    jnz         Close_Gdiplus

    invoke      GdipBitmapLockBits,pImage,NULL,ImageLockModeRead,PixelFormat32bppARGB,offset GDIplusBitmapData
    test        eax,eax
    jnz         Close_Image

    mov         esi,pImageData

    invoke      ReleaseBitmapMemory,dword ptr [esi]
    test        eax,eax
    jz          UnlockBitmap
       
    mov         eax,GDIplusBitmapData.dwWidth
    shl         eax,2
    mul         GDIplusBitmapData.dwHeight
    invoke      VirtualAlloc,0,eax,MEM_COMMIT or MEM_RESERVE,PAGE_READWRITE
    test        eax,eax
    jz          UnlockBitmap

    mov         dword ptr [esi],eax             ; save the virtual memory pointer
    mov         edi,eax                         ; pointer to the raw 32 bit bitmap data

CopyBitMap:   
    mov         esi,GDIplusBitmapData.Scan0     ; pointer to the bitmap data
   
    mov         ecx,GDIplusBitmapData.dwHeight
Height_lp:
    mov         edx,GDIplusBitmapData.dwWidth
    xor         ebx,ebx
Width_lp:
    mov         eax,dword ptr [esi+ebx]
    mov         dword ptr [edi],eax
    add         ebx,4
    add         edi,4
    dec         edx
    jnz         Width_lp
    add         esi,GDIplusBitmapData.Stride   
    dec         ecx
    jnz         Height_lp   

    mov         ReturnMessage,D3D_OK
UnlockBitmap:
    invoke      GdipBitmapUnlockBits,pImage,offset GDIplusBitmapData
Close_Image:
    invoke      GdipDisposeImage,pImage
Close_Gdiplus:
    mov         ecx,GDIplusBitmapData.dwWidth
    mov         edx,GDIplusBitmapData.dwHeight
Exit_LoadImage:
    mov         eax,ReturnMessage
    ret

LoadBitmapData endp

; function:
invoke LoadBitmapData,TEXT_("Lena320.png"),offset SourceBitmapData



EDIT: added the missing BitmapData structure
Creative coders use backward thinking techniques as a strategy.

Siekmanski

This is how to create a pImage from the raw 32bit ARGB bitmap data in memory


I_pBits = the memory pointer to the raw 32bit ARGB bitmap data in memory
I_Stride = I_Width * 4

    invoke  GdipCreateBitmapFromScan0,I_Width,I_Height,I_Stride,PixelFormat32bppRGB,I_pBits,offset pImage


Now you can use "pImage" with one of the routines in GdiPlusColors.zip to save it in the format you like.
Creative coders use backward thinking techniques as a strategy.

hutch--

Hi Guga,

Using the code by Marinus is a better choice, I converted his and Vortex's code to 64 bit MASM but it would be no joy to convert as the architecture is different between 32 and 64 bit. I have it ready as example code for 64 bit MASM but the procedures are in the library so they can be reused in 64 bit MASM code.

hutch--

Here is my most recent attempt to emulate old film, its an old stone church in the area where I live. Its almost OK but I have not yet worked out how to do the flickering that very old film had. I want it to look like the technology of the very old movie Nosferatu.

https://www.youtube.com/watch?v=4ZLL_P84IoI

guga

Here is my most recent attempt to emulate old film, its an old stone church in the area where I live. Its almost OK but I have not yet worked out how to do the flickering that very old film had. I want it to look like the technology of the very old movie Nosferatu.
:greensml: :greensml: :greensml: I love that movie.

Excellent work :)   :greenclp: :greenclp: :greenclp: :greenclp:

What program do you use to work with video ? If you use sony vegas  or premiere, there´s a filter called "Ignite Flicker" that you can play with.


Or, you can also try with virtualdub. I remember seeing a flickering filter that works on it. I don´t remember the name because my HD where Vdub was stored, simply fried last month  :dazzled: :dazzled: :dazzled: :sad: :sad:

But, it do exists a filter for vdub that can also do the flickering for you. Other filters have those large black and white spots simulating a damage on the film which also brings more realism when you want to make a new video looks like and old one. Or even adding some effects of increasing the contrast and blurring a little a couple of frames also makes it looks like something filmed back in the 1910´s.

You could also try decrease the framerate in something in between 16 to 20 fps and later rebuild the video to 29.970.  This would delete some frames and simulate those "stops motions" that old movies does when people are moving, for example. That thing that happens when you see a guy with his hand raised and the next frame it immediately have his hands on the floor :mrgreen: :mrgreen: :mrgreen:

Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

guga

Quote from: Siekmanski on August 07, 2020, 12:14:14 AM
This is how to create a pImage from the raw 32bit ARGB bitmap data in memory


I_pBits = the memory pointer to the raw 32bit ARGB bitmap data in memory
I_Stride = I_Width * 4

    invoke  GdipCreateBitmapFromScan0,I_Width,I_Height,I_Stride,PixelFormat32bppRGB,I_pBits,offset pImage


Now you can use "pImage" with one of the routines in GdiPlusColors.zip to save it in the format you like.

Thank you a lot marinus and steve.

Marinus, what´s the format of the structure"GDIplusBitmapData" ? I can´t find it .
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

hutch--

Hi Guga,

I use MovAvi as its more or less useful. It started out a bit "cheap and cheerful" but has got a lot better over time (Software from Novosibirsk in Siberia). For doing the final finishing I use FFMPEG for image sizing, fine control of sharpening/smoothing and bitrate. If you look in the Microsoft 64 bit MASM »Tools & Toys sub forum I have a number of interfaces that use FFMPEG and all you need is to have FFMPEG in your path and they work fine.

RE : The cooked HDD, something I learn long ago was to put all of my HDDs behind a front case fan as disks last a lot longer if you don't cook them.

hutch--

Guga,

Here are some scaling algos. These are in 64 bit but easy enough to convert to 32 bit.

IMPORTANT : Use this option as it improves the quality. ====>>>> SetStretchBltMode,dDC,HALFTONE

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

scale_image_by_size proc hWin:QWORD,bitmap:QWORD,nWid:QWORD,nHgt:QWORD

    LOCAL hDC   :QWORD                                          ; original window DC
    LOCAL sDC   :QWORD                                          ; source bitmap DC
    LOCAL dDC   :QWORD                                          ; destination bitmap DC

    LOCAL srcWd :QWORD
    LOCAL srcHt :QWORD

    LOCAL nubmp :QWORD                                          ; new bmp handle
    LOCAL hOld  :QWORD

    rcall GetBmpSize,bitmap                                     ; get source bitmap size
    mov srcWd, rax
    mov srcHt, rcx

    mov hDC, rvcall(GetDC,hWin)                                 ; get the window DC
    mov sDC, rvcall(CreateCompatibleDC,hDC)                     ; create the source DC
    mov dDC, rvcall(CreateCompatibleDC,hDC)                     ; create the destination DC

    rcall SelectObject,sDC,bitmap                               ; select source bitmap
    mov hOld, rax

    mov nubmp, rvcall(CreateCompatibleBitmap,hDC,nWid,nHgt)     ; create the new bitmap
    rcall SelectObject,dDC,nubmp                                ; select destination bitmap

    rcall SetStretchBltMode,dDC,HALFTONE                        ; set mode to HALFTONE
    rcall SetBrushOrgEx,dDC,0,0,0
    invoke StretchBlt,dDC,0,0,nWid,nHgt, \
                      sDC,0,0,srcWd,srcHt,SRCCOPY               ; scale source to destination

    rcall SelectObject,sDC,hOld                                 ; re select old object

    rcall DeleteDC,sDC                                          ; deallocate the device contexts
    rcall DeleteDC,dDC
    rcall ReleaseDC,hWin,hDC

    mov rax, nubmp                                              ; return new bitmap handle

    ret

scale_image_by_size endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

By percent.

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

scale_image_by_percent proc hWin:QWORD,bitmap:QWORD,percnt:QWORD

    LOCAL hDC   :QWORD                                          ; original window DC
    LOCAL sDC   :QWORD                                          ; source bitmap DC
    LOCAL dDC   :QWORD                                          ; destination bitmap DC

    LOCAL srcWd :QWORD
    LOCAL srcHt :QWORD

    LOCAL nWid  :QWORD                                          ; width of new bmp
    LOCAL nHgt  :QWORD                                          ; height of new bmp
    LOCAL nubmp :QWORD                                          ; new bmp handle
    LOCAL hOld  :QWORD

    rcall GetBmpSize,bitmap                                     ; get source bitmap size
    mov srcWd, rax
    mov srcHt, rcx

    mov hDC, rvcall(GetDC,hWin)                                 ; get the window DC
    mov sDC, rvcall(CreateCompatibleDC,hDC)                     ; create the source DC
    mov dDC, rvcall(CreateCompatibleDC,hDC)                     ; create the destination DC

    rcall SelectObject,sDC,bitmap                               ; select source bitmap
    mov hOld, rax

    mov nWid, rvcall(getpercent,srcWd,percnt)                   ; calculate new width
    mov nHgt, rvcall(getpercent,srcHt,percnt)                   ; calculate new height

    add nWid, 1                                                 ; correct for zero based index
    add nHgt, 1

    mov nubmp, rvcall(CreateCompatibleBitmap,hDC,nWid,nHgt)     ; create the new bitmap
    rcall SelectObject,dDC,nubmp                                ; select destination bitmap

    rcall SetStretchBltMode,dDC,HALFTONE                        ; set mode to HALFTONE
    rcall SetBrushOrgEx,dDC,0,0,0
    invoke StretchBlt,dDC,0,0,nWid,nHgt, \
                      sDC,0,0,srcWd,srcHt,SRCCOPY               ; scale source to destination

    rcall SelectObject,sDC,hOld                                 ; re select old object

    rcall DeleteDC,sDC                                          ; deallocate the device contexts
    rcall DeleteDC,dDC
    rcall ReleaseDC,hWin,hDC

    mov rax, nubmp                                              ; return new bitmap handle

    ret

scale_image_by_percent endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

getpercent

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤

getpercent proc src:QWORD,pcnt:QWORD

    mov r10, pcnt
    shl src, 10
    shl pcnt, 10

    fn intdiv,src,100
    fn intmul,rax,r10

    shr rax, 10

    ret

getpercent endp

; ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤


guga

Great. Tks Steve


Btw, marinus and Steve


Marinus, if you would like to add more equates to GdiPlus header. here are some more:

Hvec and Webp guids and also EMF, ico

IMAGE_BMP     0
IMAGE_JPG      1
IMAGE_GIF      2
IMAGE_EMF      3
IMAGE_WMF      4
IMAGE_TIF      5
IMAGE_PNG      6
IMAGE_ICO      7
IMAGE_HEIF     8
IMAGE_WEBP     9


[CLSID_BMP: D$ 0557CF400, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E
CLSID_JPG: D$ 0557CF401, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E
CLSID_GIF: D$ 0557CF402, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E
CLSID_TIF: D$ 0557CF405, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E
CLSID_PNG: D$ 0557CF406, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E
CLSID_ICO: D$ 0557CF407, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E]

[CLSID_EMF: D$ 0557CF403, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E]
[CLSID_WMF: D$ 0557CF404, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E]
[CLSID_HEIF: D$ 0557CF408, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E]
[CLSID_WEBP: D$ 0557CF409, W$ 01A04, 011D3,  B$ 09A, 073, 0, 0, 0F8, 01E, 0F3, 02E]

For the PixelFormat, i found these

value in hexa             Corresponding Guid
030101                      GUID_WICPixelFormat1bppIndexed
010212                      GUID_WICPixelFormat2bppIndexed
030402                      GUID_WICPixelFormat4bppIndexed
030803                      GUID_WICPixelFormat8bppIndexed
0811                          GUID_WICPixelFormat8bppGray
0101004                    GUID_WICPixelFormat16bppGray
021005                      GUID_WICPixelFormat16bppBGR555
021006                      GUID_WICPixelFormat16bppBGR565
061007                      GUID_WICPixelFormat16bppBGRA5551
021808                      GUID_WICPixelFormat24bppBGR
021810                      GUID_WICPixelFormat24bppRGB
022009                      GUID_WICPixelFormat32bppBGR
026200A                    GUID_WICPixelFormat32bppBGRA
0E200B                      GUID_WICPixelFormat32bppPBGRA
0200F                        GUID_WICPixelFormat32bppCMYK
010300C                    GUID_WICPixelFormat48bppBGRFixedPoint
034400D                    GUID_WICPixelFormat64bppBGRAFixedPoint
01C400E                    GUID_WICPixelFormat64bppBGRAFixedPoint

Used guids values from above

DEFINE_GUID IMGFMT_WEBP, 0x0B96B3CB7,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);
DEFINE_GUID IMGFMT_HEIF, 0x0B96B3CB6,0x0728,0x11d3,0x9d,0x7b,0x00,0x00,0xf8,0x1e,0xf3,0x2e);

GUID_WICPixelFormatDontCare dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0
GUID_WICPixelFormat1bppIndexed dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 1
GUID_WICPixelFormat2bppIndexed dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 2
GUID_WICPixelFormat4bppIndexed dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 3
GUID_WICPixelFormat8bppIndexed dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 4
GUID_WICPixelFormatBlackWhite dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 5
GUID_WICPixelFormat2bppGray dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 6
GUID_WICPixelFormat4bppGray dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 7
GUID_WICPixelFormat8bppGray dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 8
GUID_WICPixelFormat16bppBGR555 dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 9
GUID_WICPixelFormat16bppBGR565 dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Ah
GUID_WICPixelFormat16bppBGRA5551 dd 5EC7C2Bh
dw 0F1E6h
dw 4961h
db 0ADh, 46h, 0E1h, 0CCh, 81h, 0Ah, 87h, 0D2h
GUID_WICPixelFormat16bppGray dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Bh
GUID_WICPixelFormat24bppBGR dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Ch
GUID_WICPixelFormat24bppRGB dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Dh
GUID_WICPixelFormat32bppBGR dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Eh
GUID_WICPixelFormat32bppBGRA dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 0Fh
GUID_WICPixelFormat32bppPBGRA dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 10h
GUID_WICPixelFormat32bppGrayFloat dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 11h
GUID_WICPixelFormat32bppRGBA dd 0F5C7AD2Dh
dw 6A8Dh
dw 43DDh
db 0A7h, 0A8h, 0A2h, 99h, 35h, 26h, 1Ah, 0E9h
GUID_WICPixelFormat32bppPRGBA dd 3CC4A650h
dw 0A527h
dw 4D37h
db 0A9h, 16h, 31h, 42h, 0C7h, 0EBh, 0EDh, 0BAh
GUID_WICPixelFormat48bppRGB dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 15h
GUID_WICPixelFormat48bppBGR dd 0E605A384h
dw 0B468h
dw 46CEh
db 0BBh, 2Eh, 36h, 0F1h, 80h, 0E6h, 43h, 13h
GUID_WICPixelFormat64bppRGBA dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 16h
GUID_WICPixelFormat64bppBGRA dd 1562FF7Ch
dw 0D352h
dw 46F9h
db 97h, 9Eh, 42h, 97h, 6Bh, 79h, 22h, 46h
GUID_WICPixelFormat64bppPRGBA dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 17h
GUID_WICPixelFormat64bppPBGRA dd 8C518E8Eh
dw 0A4ECh
dw 468Bh
db 0AEh, 70h, 0C9h, 0A3h, 5Ah, 9Ch, 55h, 30h
GUID_WICPixelFormat16bppGrayFixedPoint dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 13h
GUID_WICPixelFormat48bppBGRFixedPoint dd 49CA140Eh
dw 0CAB6h
dw 493Bh
db 9Dh, 0DFh, 60h, 18h, 7Ch, 37h, 53h, 2Ah
GUID_WICPixelFormat32bppCMYK dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 1Ch
GUID_WICPixelFormat64bppRGBAFixedPoint dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 1Dh
GUID_WICPixelFormat64bppBGRAFixedPoint dd 356DE33Ch
dw 54D2h
dw 4A23h
db 0BBh, 4, 9Bh, 7Bh, 0F9h, 0B1h, 0D4h, 2Dh
GUID_WICPixelFormat64bppRGBFixedPoint dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 40h
GUID_WICPixelFormat64bppRGBAHalf dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 3Ah
GUID_WICPixelFormat64bppRGBHalf dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 42h
GUID_WICPixelFormat16bppGrayHalf dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 3Eh
GUID_WICPixelFormat32bppGrayFixedPoint dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 3Fh
GUID_WICPixelFormat64bppCMYK dd 6FDDC324h
dw 4E03h
dw 4BFEh
db 0B1h, 85h, 3Dh, 77h, 76h, 8Dh, 0C9h, 1Fh



Btw...The above  guids and values (including yours)  are accessed in GdiPlus at: GdipGetImageEncodersSize and GdipGetImageDecodersSize apis that leads to a internal function called "InitializeBuiltinCodecs".


Those data are stored as a array of structures pointed from inside that InitializeBuiltinCodecs function. I presume it is something like: ImageCodecInfo. Not sure it if is documented, but, anyway, i named the structure to what it seems to be doing as:

GugaImageCodecInfo struc
        CLSID dd ?
        FormatID dd ?
        CodecName dd ?
        FormatDescription dd ?
        FilenameExtension dd ?
        MimeType dd ?
        Version dd 4 dup(?)
        Signature dd ?
        SignatureReserved dd ?
        pInstanceFunction dd ?
GugaImageCodecInfo ends



The above structure, btw, is almost equal to this:
https://www.sagara.net/2010/01/25/imagecodecinfo-encoder-and-decoder-information/
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com