pixelsearch Posted June 30 Posted June 30 (edited) Quick test after download 5 min ago : new version (x86) works fine for showing progress in Console & aborting (Esc) during progress, in Example 9. Well done ! Edited June 30 by pixelsearch "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 2 Author Posted July 2 Updated to WebP v0.3.6 build 2025-07-02 beta -> you can convert now GIF animated files to WebP animated files (see Example10.au3 on my 1Drv). KaFu and pixelsearch 2 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 2 Posted July 2 Impressive, an animated gif file (8-cell.gif : 3554 KB) became (ConvertedFromGIF.webp : 394 KB) this is about 9 times smaller with good quality. Console output : GIF filesize: 3638957 WebP filesize: 403202 Well done UEZ "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 2 Author Posted July 2 (edited) In the example I've chosen 10 (out of 100 = nearly no compression). You may see artifacts in the WebP file with 10 as quality. Btw, I don't know why but the WebP animation is one frame less at least for one gif. Maybe depends on the gif file... Anyhow, thanks for testing. 👍 Edited July 2 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 3 Posted July 3 8 hours ago, UEZ said: Anyhow, thanks for testing. 👍 You're welcome, it's the least we can do for you Just curious : example 8 creates a WebP animation from 4 possible types of image files : "images (*.jpg;*.png;*.bmp;*.gif)" Do you think it would be possible to add this 5th type of image file, if not too complicated ? "images (*.jpg;*.png;*.bmp;*.gif;*.webp)" Thanks UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 3 Author Posted July 3 Updated to WebP v0.3.7 build 2025-07-03 beta You can now create WebP anim files from WebP image files and you can extract frames from a WebP anim file to WebP image file format. Supported GDIPlus image formats: "bmp", "gif", "jpg", "tif", "png" pixelsearch, SOLVE-SMART and KaFu 2 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 4 Posted July 4 @UEZ hello. I got 2 questions if you don't mind : 1) Func WebP_CreateWebPCreateAnim As $aFilenames must be 2D, could the following line in the function use a simpler syntax ? ; $tArrayFramesDelay.delay($i + 1) = UBound($aFilenames, 2) ? ($aFilenames[$i][1] > 0 ? $aFilenames[$i][1] : $iDefaultDelay) : $iDefaultDelay $tArrayFramesDelay.delay($i + 1) = $aFilenames[$i][1] > 0 ? $aFilenames[$i][1] : $iDefaultDelay 2) Concerning this line in example 8 : $aFrames[$i - 2][1] = $iGDelay + $i * 2 Could you please explain the need of "$i * 2" which will slowly increase the delay between each frame ? For example, using the 10 "crow" pics to create a WebP animation, here are the delays in the structure : 64 ms after frame 1 (60 + 2*2) 82 ms after frame 10 (60 + 11*2) If not mistaken, when an animation got 50 frames, it would add 100ms during the last frames, 200ms if 100 frames etc... Thanks UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 4 Author Posted July 4 Hi @pixelsearch 2 hours ago, pixelsearch said: As $aFilenames must be 2D, could the following line in the function use a simpler syntax ? The idea was check if array is 2D but you are right, instead of checking permanently the array, one check should be enough -> fixed. 2 hours ago, pixelsearch said: Could you please explain the need of "$i * 2" which will slowly increase the delay between each frame ? I wanted to see if delays are properly added to the animation. There no other reason to slow down the frames. 🙂 pixelsearch 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 4 Posted July 4 2 hours ago, UEZ said: The idea was check if array is 2D So my secret guess was wrong on this 1st point I thought that maybe, while scripting it, you'd allow a 1D array to be used too, containing only the filenames, something like this in example 8 alt : ;~ Global $aFrames[UBound($aFiles) - 2][2] ;~ For $i = 2 To UBound($aFiles) - 1 ;~ $aFrames[$i - 2][0] = $aFiles[1] & "\" & $aFiles[$i] ;~ $aFrames[$i - 2][1] = $iGDelay + $i * 2 ;~ Next Global $aFrames[UBound($aFiles) - 2] For $i = 2 To UBound($aFiles) - 1 $aFrames[$i - 2] = $aFiles[1] & "\" & $aFiles[$i] Next Of course it requires to alter/duplicate a couple of lines in Func WebP_CreateWebPCreateAnim, to take care of the possibility that the array may be 1D In this case, your original line shows it power again, accepting that the array is 1D or 2D : $tArrayFramesDelay.delay($i + 1) = UBound($aFilenames, 2) ? ($aFilenames[$i][1] > 0 ? $aFilenames[$i][1] : $iDefaultDelay) : $iDefaultDelay Just for fun, I tested this yesterday (1D array in example 8 and in Func WebP_CreateWebPCreateAnim), everything worked nicely and the default delay of 75ms between frames was applied. 2 hours ago, UEZ said: 4 hours ago, pixelsearch said: Could you please explain the need of "$i * 2" which will slowly increase the delay between each frame ? I wanted to see if delays are properly added to the animation. There no other reason to slow down the frames. 🙂 Yesss, my secret guess was right on this second point For the record, here is how an old version of Animation Shop (bundled with PaintShop Pro) handles the delays while creating an animated gif : We just indicated a global delay applied between all frames (10/100th seconds in the pic, that's 100ms) . This correspond to your $iDefaultDelay = 75 in the function. When the animation is done, there's a possibility to alter one/several/all delays : for example I changed the delay of frame 2 to 150ms in the pic above (see "Frame;2 Delay:15") . Applied to your function, this corresponds to the delays the user may indicate in the 2D array (last column) So that's a good reason for using a 2D array. You can alter some important delays when needed. Try to do it with a 1D array ! Thanks for all your work and have a great evening UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 4 Author Posted July 4 34 minutes ago, pixelsearch said: In this case, your original line shows it power again, accepting that the array is 1D or 2D Yes, that was the reason for that line if Array is only 1D. When you display the animation, you can choose to play it one time, n times or endless but there is also an option to set loop_count. I will add it as an parameter that external players can play it accordingly. Thanks for your feedback! Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
UEZ Posted July 4 Author Posted July 4 (edited) Updated to v0.3.8 build 2025-07-04 beta added loop count parameter for the 3 animation functions. Default = 0 which is endless. added WebP_GetImagesDiffFromFile() which can compare two WebP files which same dimension Edited July 4 by UEZ pixelsearch and argumentum 2 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 4 Posted July 4 Hellooo Just to let you know : example 11 throws an error with the 4th parameter found in the actual script (as it corresponds to your config) Global $aResult = WebP_GetImagesDiffFromFile($aFiles[0] & "\" & $aFiles[1], $aFiles[0] & "\" & $aFiles[2], 2, "c:\_BZ25LN\Coding\FreeBASIC\__UEZ\_Graphical Stuff\WebP\WebP-dll.dll") Of course it works fine without the 4th parameter : Global $aResult = WebP_GetImagesDiffFromFile($aFiles[0] & "\" & $aFiles[1], $aFiles[0] & "\" & $aFiles[2], 2) UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 4 Author Posted July 4 (edited) Oops, forgot to remove the manual path to the DLL. Fixed. Edited July 4 by UEZ argumentum 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 5 Posted July 5 (edited) @UEZ Hi. Two points to share with you : 1) Example 8 * If the output animation "TestAnim.webp" already exists, then no error is thrown if the user selects only 1 file for the animation (what a silly idea !) and the old animation "TestAnim.webp" is displayed (bad behavior) * If the output animation "TestAnim.webp" doesn't exist, then an error is thrown if the user selects only 1 file for the animation (this should be the standard behavior, no matter the animation already exists or not) A possible solution could be to delete in all cases the old animation that may exist, before processing. 2) Example 8 with function _ShowParams() Could you please try this modified version of Example 8 and give your opinion ? It allows to modify through a GUI any optional parameter from Func WebP_CreateWebPCreateAnim This could be useful when functions got plenty of parameters (20 in this case) . Also the function could be easily adaptable to other scripts, as it is self contained Thanks expandcollapse popup;Coded by UEZ / pixelsearch (example08.1) (August 19th, 2025) #AutoIt3Wrapper_UseX64=y #include "WebP.au3" If WebP_Ver2() < "0.4.4" Then Exit MsgBox($MB_ICONERROR, "ERROR", "DLL Version v0.4.4.+ required!", 30) Global $sFiles = FileOpenDialog("Select image frames for WebP animation", "", "images (*.jpg;*.png;*.bmp;*.gif;*.webp)", BitOR($FD_FILEMUSTEXIST, $FD_PATHMUSTEXIST, $FD_MULTISELECT)) If @error Then Exit Global $aFiles = StringSplit($sFiles, "|"), $iFileSizeAllFrames = 10, $iGDelay = 60 Global $aFrames[UBound($aFiles) - 2][2] For $i = 2 To UBound($aFiles) - 1 $aFrames[$i - 2][0] = $aFiles[1] & "\" & $aFiles[$i] $iFileSizeAllFrames += FileGetSize($aFrames[$i - 2][0]) Next _GDIPlus_Startup() Global $sFile = @ScriptDir & "\TestAnim.webp" Global $iResult = _ShowParams("WebP_CreateWebPCreateAnim", $aFrames, $sFile) If $iResult < 1 Or @error Then ConsoleWrite($iResult & " / " & @error & @CRLF) _GDIPlus_Shutdown() Exit MsgBox($MB_ICONERROR, "Error", "Something went wrong creating the animation!") EndIf Global $iAnimFileSize = FileGetSize($sFile) Global $iUB, $aDim $tFrames = WebP_ExtractAnimFramesToMem($sFile, $iUB) If @error Then Exit MsgBox($MB_ICONERROR, "Error", "Something went wrong extracting frames!") $aDim = _GDIPlus_ImageGetDimension($tFrames.array((1))) ConsoleWrite($aDim[0] & "x" & $aDim[1] & @CRLF) ConsoleWrite($iUB / 2 & " frames in total" & @CRLF) ConsoleWrite("All file size: " & $iFileSizeAllFrames & " bytes" & @CRLF) ConsoleWrite("Animation file size: " & $iAnimFileSize & " bytes" & @CRLF) ConsoleWrite("Ratio: " & $iAnimFileSize / $iFileSizeAllFrames & @CRLF) Global $fSize = 1 Global Const $hGUI = GUICreate("WebP Anim UDF Example", $aDim[0] * $fSize, $aDim[1] * $fSize) Global Const $iPic = GUICtrlCreatePic("", 0, 0, $aDim[0] * $fSize, $aDim[1] * $fSize) GUISetState() Global $iCurrentFrame = 1, $i AdlibRegister("PlayAnimPreview", 10) Do If GUIGetMsg() = $GUI_EVENT_CLOSE Then AdlibUnRegister("PlayAnimPreview") For $i = 1 To $iUB Step 2 _GDIPlus_ImageDispose($tFrames.array(($i))) Next _GDIPlus_Shutdown() GUIDelete() Exit EndIf Until False Func PlayAnimPreview() AdlibUnRegister("PlayAnimPreview") Local $iDelay = Int($tFrames.array(($iCurrentFrame + 1))) Local Static $iTimerCurrentFrame = TimerInit() Local $hBmp = _GDIPlus_BitmapCreateFromScan0($aDim[0] * $fSize, $aDim[1] * $fSize) Local $hGfx = _GDIPlus_ImageGetGraphicsContext($hBmp) _GDIPlus_GraphicsSetInterpolationMode($hGfx, $GDIP_INTERPOLATIONMODE_NEARESTNEIGHBOR) _GDIPlus_GraphicsClear($hGfx, 0xFFFFFFFF) _GDIPlus_GraphicsDrawImageRectRect($hGfx, $tFrames.array(($iCurrentFrame)), 0, 0, $aDim[0], $aDim[1], 0, 0, $aDim[0] * $fSize, $aDim[1] * $fSize) Local $hBitmap_GDI = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) _WinAPI_DeleteObject(GUICtrlSendMsg($iPic, 0x0172, 0, $hBitmap_GDI)) ;$STM_SETIMAGE = 0x0172, $IMAGE_BITMAP = 0 _WinAPI_DeleteObject($hBitmap_GDI) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_BitmapDispose($hBmp) If TimerDiff($iTimerCurrentFrame) > $iDelay Then $iCurrentFrame += 2 $iTimerCurrentFrame = TimerInit() EndIf If $iCurrentFrame > $iUB Then $iCurrentFrame = 1 AdlibRegister("PlayAnimPreview", 10) EndFunc ;==>PlayAnimPreview ;by pixelsearch - thx! Func _ShowParams($sFuncName, ByRef $Par1, ByRef $Par2) Local $aArray, $aHelp, $aMsg, $aToolTip, $bToolTip, $hGUIHelp = 0, $hGUIPar, $idCancel, $idEdit, $idHelp, $idOK, $iPos, $iPosEqual, $iRet, _ $sFileRead, $sFuncExec, $sHelp, $sPattern, $sString ; important $hGUIHelp = 0 (+++) $sFileRead = FileRead(@ScriptDir & "\WebP.au3") If @error Then Exit MsgBox(0, "WebP.au3", "Couldn't read the file") $sPattern = '(?Usi)Func ' & $sFuncName & '\(.*\)\v' ; \v to ignore possible ")" inside parameters values $aArray = StringRegExp($sFileRead, $sPattern, 1) If @error Then Exit MsgBox(0, "WebP.au3", "Couldn't find Func " & $sFuncName) $sString = StringReplace($aArray[0], StringInStr($aArray[0], ")", 0, -1), ", ") ; standardize last ending to ", " $sPattern = '(?U)(\$.*,\x20)' $aArray = StringRegExp($sString, $sPattern, 3) $sPattern = '(?Usi)' & $sFuncName & '\(.*(; Parameters.*)\R; (?:Return value|Requirement).*Func ' & $sFuncName & '\(' $aHelp = StringRegExp($sFileRead, $sPattern, 1) $aToolTip = StringSplit($aHelp[0], @CRLF, 1 + 2) $bToolTip = (Ubound($aArray) = Ubound($aToolTip)) ? True : False $sHelp = StringStripWS( StringReplace($aHelp[0], @CRLF, Chr(1) & Chr(255)) , 4) ; for Help button $sHelp = StringReplace($sHelp, Chr(1) & Chr(255), @CRLF) Local $idPar[UBound($aArray)] $hGUIPar = GUICreate($sFuncName, 410, 20 + UBound($aArray) * 25) For $i = 0 To UBound($aArray) - 1 $aArray[$i] = StringTrimRight($aArray[$i], 2) ; delete last 2 characters ", " $iPosEqual = StringInStr($aArray[$i], "=") GUICtrlCreateLabel(($iPosEqual ? StringLeft($aArray[$i], $iPosEqual - 1) : $aArray[$i]), 20, 13 + $i * 25, 100, 20) If $bToolTip Then $iPos = StringInStr($aToolTip[$i], StringStripWS(GUICtrlRead(-1), 1 + 2)) If $iPos Then GUICtrlSetTip(-1, StringStripWS(StringMid($aToolTip[$i], $iPos), 4)) EndIf $idPar[$i] = GUICtrlCreateInput("", 130, 10 + $i * 25, 160, 20) If $i + 1 < @NumParams Then GUICtrlSetData(-1, Eval("Par" & $i + 1)) GUICtrlSetState(-1, $GUI_DISABLE) Else GUICtrlSetData(-1, ($iPosEqual ? StringMid($aArray[$i], $iPosEqual + 1) : "")) EndIf Next $idOK = GUICtrlCreateButton("OK", 310, 20, 80, 25) $idCancel = GUICtrlCreateButton("Cancel", 310, 65, 80, 25) $idHelp = GUICtrlCreateButton("Help", 310, 110, 80, 25) GUISetState(@SW_SHOW, $hGUIPar) While 1 $aMsg = GUIGetMsg(1) If Not IsHWnd($aMsg[1]) Then ContinueLoop ; wiki Managing multiple GUIs Switch $aMsg[1] Case $hGUIPar Switch $aMsg[0] Case $idOK If WinExists($hGUIHelp) Then GUIDelete($hGUIHelp) ExitLoop Case $idCancel, $GUI_EVENT_CLOSE _GDIPlus_Shutdown() Exit Case $idHelp GUICtrlSetState($idHelp, $GUI_DISABLE) $hGUIHelp = GUICreate($sFuncName & " (help)", 800, 400, -1, -1, $WS_OVERLAPPEDWINDOW) $idEdit = GUICtrlCreateEdit($sHelp, 10, 10, 780, 380, BitOr(0x003010C0, 0x0800)) ; $GUI_SS_DEFAULT_EDIT + $ES_READONLY GUICtrlSetFont(-1, 10) GUISetState(@SW_SHOW, $hGUIHelp) EndSwitch Case $hGUIHelp Switch $aMsg[0] Case $GUI_EVENT_CLOSE GUIDelete($hGUIHelp) $hGUIHelp = 0 ; +++ GUICtrlSetState($idHelp, $GUI_ENABLE) EndSwitch EndSwitch WEnd $sFuncExec = $sFuncName & "(" For $i = 0 To UBound($aArray) - 1 If $i + 1 < @NumParams Then $sFuncExec &= "$Par" & $i + 1 & ", " Else $sFuncExec &= StringStripWS(GUICtrlRead($idPar[$i]), 3) & ($i < UBound($aArray) - 1 ? ", " : ")") EndIf Next ConsoleWrite($sFuncExec & @CRLF) GUIDelete($hGUIPar) $iRet = Execute($sFuncExec) Return SetError(@error, @extended, $iRet) EndFunc ;==>_ShowParams Update July 6th, 2025 Gui design (minor) Insensitive flag in one RegEx pattern Return value , @error , @extended : all checkable in main Each parameter got its explanative tooltip (as found in UEZ's UDF) Update July 7th, 2025 * $GUI_EVENT_CLOSE reacts now like the button "Cancel" : it exits the script. This is the behaviour UEZ adopted in his example "101" found on his onedrive link (see 1st post for the link) . I'm glad you could simply copy/paste the function _ShowParams() from one script to the other and everything worked smoothly * Also, based on example "101", I replaced this line... $sFuncExec &= GUICtrlRead($idPar[$i]) & ($i < UBound($aArray) - 1 ? "," : ")") ...with $sFuncExec &= StringStripWS(GUICtrlRead($idPar[$i]), 3) & ($i < UBound($aArray) - 1 ? ", " : ")") It's safer as it strips possible spaces left by the user in the Input fields. A difference with example "101" : I added a space after the comma which means ", " instead of "," It allows to construct the variable $sFuncExec with parameters nicely separated, visible in the Console during debug process (or always if the line ConsoleWrite($sFuncExec & @CRLF) is left uncommented in the script) : WebP_CreateWebPCreateAnim($Par1, $Par2, 75.0, 0, 4, 60, 50, 1, 6, 0, 100, 1, 1, 100, 0, 0, $WEBP_PRESET_DEFAULT, 75, 0, "") Update August 4th, 2025 Modified the line which checks the dll version, to reflect UEZ last update (note : this will be updated again to indicate "0.4.4" in a few days) If WebP_Ver2() < "0.4.3" Then Exit MsgBox($MB_ICONERROR, "ERROR", "DLL Version v0.4.3.+ required!", 30) Update August 19th, 2025 @UEZ Added a help button, to display in a separate GUI all the parameters and their meanings. Tooltips are still here of course, but sometimes we need to have a look at several parameters meaning at same time : it happened to me yesterday while converting an animated GIF to mp4 (using ffmpeg) then the same animated GIF to an animated WebP, using your example 10.1 Edited August 19 by pixelsearch Update August 19th, 2025 (re-edited at 7 pm) "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 5 Author Posted July 5 (edited) Hi @pixelsearch thank again for your feedback. Regarding 1) my bad. The example 08 doesn't contain a check if creation fails - it just proceeds. Easy to fix: Global $sFile = @ScriptDir & "\TestAnim.webp" Global $iResult = WebP_CreateWebPCreateAnim($aFrames, $sFile) If $iResult < 1 Or @error Then ConsoleWrite($iResult & " / " & @error & @CRLF) _GDIPlus_Shutdown() Exit MsgBox($MB_ICONERROR, "Error", "Something went wrong creating the animation!") EndIf 2) to be honest - I'm too lazy to create a GUI with all parameters. I'm not sure if all the parameters are required or will ever be needed, but I'm happy to include this as Example08.1.au3. It would only make sense if the value range per parameter was listed in the GUI. The ranges should be described in the UDF header. Edited July 5 by UEZ argumentum and pixelsearch 2 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
pixelsearch Posted July 5 Posted July 5 Glad you liked it imho _ShowParams() is great because we don't need to check any Default value in the UDF to use it. For example, if I want to use $iDefaultDelay (the 18th parameter) with a value of 150, I don't need to indicate any of the 15 preceding optional values in the calling script. Another solution could have been to add 18 lines in the UDF but that's very boring : If ... = Default Then ... If ... = Default Then ... And then call the function with endless Default parameters until the 18th parameter is reached, very boring too ! Also, it seems that the function could be easily reusable in any script : only the number of mandatory parameters should change, for example, with 3 mandatory parameters : Func _ShowParams($sFuncName, ByRef $Par1, ByRef $Par2, ByRef $Par3) But well, I just quickly scripted it, there will be probably things to modify in it, we'll see... UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
pixelsearch Posted July 5 Posted July 5 (edited) @UEZ Thanks for the upload of "WebP Example081.au3", I'm truly honored to see my nickname near yours in a script On 7/5/2025 at 8:31 PM, UEZ said: It would only make sense if the value range per parameter was listed in the GUI. The ranges should be described in the UDF header. To achieve this, I just tried the following pattern, it looks promising : (?Usi)WebP_CreateWebPCreateAnim\(.*(; Parameters.*)\R; (?:Return value|Requirement).*Func WebP_CreateWebPCreateAnim\( The string "WebP_CreateWebPCreateAnim" will be replaced by $sFuncName in the final version, to make it portable. Return in array[0] is : ; Parameters ....: $aFilenames - an 2D array of pathes to the image files and delay per frame. ; $sOutfile - filename of WebP animation output file. ; $quality - [optional] an unknown value. Default is 75.0. Valid range is 0 - 100. ; $lossless - [optional] an unknown value. Default is 0. 0 for lossy encoding / 1 for lossless. ; $method - [optional] a map. Default is 4. Valid range is 0 - 6 (0=fast, 6=slower-better). ; $filter_strength - [optional] a floating point value. Default is 60. Range: [0 = off .. 100 = strongest] ; $sns_strength - [optional] a string value. Default is 50. Spatial Noise Shaping. 0=off, 100=maximum ; $pass - [optional] a pointer value. Default is 1. Number of entropy-analysis passes (in [1..10]). ; $level - [optional] an unknown value. Default is 6. Between 0 (fastest, lowest compression) and 9 (slower, best compression) only valid for lossless = 1! ; $filter_sharpness - [optional] a floating point value. Default is 0. Range: [0 = off .. 7 = least sharp] ; $near_lossless - [optional] a general number value. Default is 100. Near lossless encoding [0 = max loss .. 100 = off (default)]. ; $alpha_compression - [optional] an array of unknowns. Default is 1. Algorithm for encoding the alpha plane (0 = none,1 = compressed with WebP lossless). Default is 1. ; $alpha_filtering - [optional] an array of unknowns. Default is 1. Predictive filtering method for alpha plane.0: none, 1: fast, 2: best. Default if 1. ; $alpha_quality - [optional] an array of unknowns. Default is 100. Between 0 (smallest size) and 100 (lossless). Default is 100. ; $target_size - [optional] a dll struct value. Default is 0. If non-zero, set the desired target size in bytes. ; $loop_count - [optional] an unknown value. Default is 0. 0 = endless. ; $WebPPreset - [optional] an unknown value. Default is $WEBP_PRESET_DEFAULT. ; $iDefaultDelay - [optional] an integer value. Default is 75. Delay in milli seconds. ; $pCallback - [optional] a pointer value. Default is 0. Pointer to a callback address for progress hook. ; $sPath2DLL - [optional] a string value. Default is "". Path to WebP dll if not in script dir. After that we'll see if it needs to be splitted into 20 lines (20 tooltips for the 20 labels while creating $hGUIPar) You may ask : "why the need of the non-capturing group ? (?:Return value|Requirement) It's just to make the pattern compatible with some UDF's of other users, for example @Melba23 in GUIListViewEx.au3 , function _GUIListViewEx_Init The same pattern (using $sFuncName etc...) will output this : (?Usi)_GUIListViewEx_Init\(.*(; Parameters.*)\R; (?:Return value|Requirement).*Func _GUIListViewEx_Init\( ; Parameters ....: $hLV - Handle or ControlID of ListView ; $aArray - Name of array used to fill ListView. "" for empty ListView ; $iStart - 0 = ListView data starts in [0] element of array (default) ; 1 = Count in [0] element ; $iColour - RGB colour for insert mark (default = black) ; $fImage - True = Shadow image of dragged item when dragging ; False = No shadow image (default) ; $iAdded - 0 - No added features (default). To get added features add any of the following values ; + 1 - Sortable by clicking on column headers ; + 2 - Do not "select all" when editing item text ; + 4 - Continue edit within same ListView by triple mouse-click on editable column ; + 8 - Headers editable by Ctrl-click (only if column editable) ; + 16 - User coloured header ; + 32 - User coloured items ; + 64 - No external drag ; + 128 - No external drop ; + 256 - No delete on external drag/drop ; + 512 - No internal drag/drop ; + 1024 - Single cell highlight (forces single row selection) This one should be just a bit harder to split into 6 tooltips... but never say never Edit: @UEZ each time the _ShowParams() function will be updated, I'll do it in the same post above, not polluting your thread with new posts. For example, I just updated it now : Gui design (minor) Insensitive flag in one RegEx pattern Return value , @error , @extended : all checkable in main Next step should be to add the tooltips as discussed above (note: it has been done this evening) Thanks for reading and have a great sunday ! Edited July 6 by pixelsearch UEZ 1 "I think you are searching a bug where there is no bug... don't listen to bad advice."
UEZ Posted July 19 Author Posted July 19 Updated to WebP v0.4.1 build 2025-07-10 beta. You can now play WebP animation in a separated thread. See WebP Example14 .1.au3 and WebP Example15.au3 ioa747, Gianni, argumentum and 1 other 4 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Gianni Posted July 20 Posted July 20 14 hours ago, UEZ said: You can now play WebP animation in a separated thread. See WebP Example14 .1.au3 and WebP Example15.au3 Running it as is, I get the following error: "Couldn't find WorkerW under Progman." I then replaced your _WinAPI_FindWindowEx() function with asnippet from this piece of code from @argumentum, and it worked fine: Func __WinAPI_FindWindowEx() Local $hWorkerW = 0, $hProgman = _WinAPI_GetShellWindow() ; WinGetHandle("[CLASS:Progman]") ;~ _SendMessage($hProgman, 0x052C) ; <<<<<< force the creation of a WorkerW handle under Progman ; https://stackoverflow.com/questions/56132584/draw-on-windows-10-wallpaper-in-c ; https://stackoverflow.com/questions/34952967/drawing-to-the-desktop-via-injection ; https://github.com/rocksdanister/lively/issues/2074 ; _WinAPI_SendMessageTimeout($hProgman, 0x052C, 0, 0, 3000, $SMTO_NORMAL) ; same as _SendMessage() If Not $hWorkerW Then ; dah Local $aEnumWindows = _WinAPI_EnumWindows(False) For $n = 1 To UBound($aEnumWindows) - 1 If $aEnumWindows[$n][1] <> "WorkerW" Then ContinueLoop If _WinAPI_GetParent($aEnumWindows[$n][0]) = $hProgman Then $hWorkerW = $aEnumWindows[$n][0] ExitLoop ; but is likely one at the end of the Z-order EndIf Next EndIf ; ConsoleWrite("WorkerW = " & $hWorkerW & @CRLF) If Not $hWorkerW Then $hWorkerW = $hProgman Return $hWorkerW EndFunc ;==>__WinAPI_FindWindowEx By the way, very great effect! 👍 UEZ and argumentum 1 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
UEZ Posted July 20 Author Posted July 20 @Giannithanks for your feedback. I changed the code for example 14 / 14.1 if @argumentum's functions works better for all OS'. Btw, I missed to dispose the animation and the old DLL will cause a memory leak. The new version should be working properly! argumentum 1 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now