Skip to content

How to Code a C NET Software to Batch Convert Images eg PNG into WEBP to Save 33 Lossless

FurkanGozukara edited this page Oct 28, 2025 · 1 revision

How to Code a C# .NET Software to Batch Convert Images (e.g. PNG) into WEBP to Save 33% - Lossless

How to Code a C# .NET Software to Batch Convert Images (e.g. PNG) into WEBP to Save 33% - Lossless

image Hits Patreon BuyMeACoffee Furkan Gözükara Medium Codio Furkan Gözükara Medium

YouTube Channel Furkan Gözükara LinkedIn Udemy Twitter Follow Furkan Gözükara

Hello everyone. In this video I code a fully multi-threaded C# application to batch process all of my images into newest best image format WEBP.

I am using C# programming language, .NET 4.8 framework, Aspose.Imaging library, and Google's cwebp and gif2webp.

I hope you enjoy, like and comment.

You can also join our discord channel and ask me any questions you would like to ask.

For statistics, over 85k images hosted on my single website, total size reduction is 32.79%

At some files it achieves up to 78% size reduction fully lossless

Our discord channel to ask whatever questions you have : https://discord.gg/6Mrb8MwteQ

How to use Discord : https://youtu.be/AEwPtYiLvsQ

Our courses playlists are like below:

[1] Introduction to Programming Full Course with C# playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffskoSXySh0MdiayPJsBZ7m2o

[2] Advanced #Programming with C# Full Course Playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslHaBdS3RUW26RKzSjkl8m4

[3] Object Oriented Programming Full Course with C# playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsnH3XJb66FDIHh1yHwWC26I

[4] Asp.NET Core V5 - MVC Pattern - Bootstrap V5 - Responsive Web #Programming with C# Full Course Playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsnAWtgk4ja3HN3xgMKF7BOE

[5] Artificial Intelligence (AI) and Machine Learning (ML) Full Course with C# Examples playlist: https://www.youtube.com/playlist?list=PL_pbwdIyffskVschrADCL6KEnL_nqDtgD

[6] Software Engineering Full Course playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslgxMVyXhnHiSn_EWTvx1G-

[7] Security of Information Systems Full Course playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffslM_o92NwkaUzD7C6Fekx26

[8] (Turkish) Bilgisayar Becerileri Tam Ders playlist : https://www.youtube.com/playlist?list=PL_pbwdIyffsmyE2e909ea1MXLcMb8MenG

Video Transcription

  • 00:00:02 Hello everyone, today I am going to make a program to reduce bandwidth usage of my web-based

  • 00:00:09 game that I developed.

  • 00:00:13 So you wonder what is that about?

  • 00:00:15 Recently I was checking my website speed with developers.google.com feature, which is page

  • 00:00:21 inside.

  • 00:00:23 Let me open it as English.

  • 00:00:29 Okay, so I am the developer of Monster MMORPG game, which is a browser-based game.

  • 00:00:36 You see this one.

  • 00:00:38 So I was checking the speed analysis of my website on page speed insights, and I have

  • 00:00:47 discovered that there is a new image format, which significantly reduces the image size

  • 00:00:56 that the image size of PNG or GPX.

  • 00:01:02 I am pretty sure you already know PNG or GPX.

  • 00:01:06 So you see the suggestions it is making is 12 images in next generation format, which

  • 00:01:15 is GPX, 2000GPX, XR or WebP.

  • 00:01:18 So in order to convert images on my website to WebP, I am going to develop a software.

  • 00:01:26 Okay, so this will be a real software that I will be using for my projects for my personal

  • 00:01:35 projects.

  • 00:01:36 And I wanted to record it so that you can also benefit from it.

  • 00:01:41 So let's start with Visual Studio Okay, and let's compose a new project.

  • 00:01:51 Create new project.

  • 00:01:53 I'm going to use vpf.net framework, you can also use dotnet core as well, it's fine.

  • 00:01:59 So the version will be 4.8 and I'm going to pick desktop as a development place.

  • 00:02:13 So let's name it as Convert to WebP Okay, let's create a project.

  • 00:02:22 I also have downloaded my static images from my web server.

  • 00:02:30 You see there are 1000s or 10s of 1000s of images.

  • 00:02:35 So manually converting them to WebP is extremely painful.

  • 00:02:40 Okay, so in order to convert images into WebP, I am going to use the WebP we can develop

  • 00:02:55 from Google WebP exit So let's go to the download page.

  • 00:03:03 And you see there is a C WebP encoder tool.

  • 00:03:07 It has some options and such.

  • 00:03:11 So we are going to call this exit from command window and convert our images Okay, so let's

  • 00:03:20 start with downloading it Where do we get there is Donald repository here.

  • 00:03:30 And from here, we are going to download latest version.

  • 00:03:35 You see they have so many versions, which is 1.2 point zero.

  • 00:03:41 And here, this one Windows x 64 Okay, and then there's our software exists here.

  • 00:03:54 So we are going to use C WebP exam.

  • 00:04:01 So let's open our debug folder here.

  • 00:04:08 And extract it C WebP here, okay.

  • 00:04:15 Alright, and let's start with initiating button.

  • 00:04:23 So this will be start converting name will be DTN button.

  • 00:04:38 And let's compose click event here.

  • 00:04:41 So first of all, we need to have a source directory and an output directory.

  • 00:04:50 Let's also name our project to convert WebP Okay, okay.

  • 00:05:04 So where is our source directories to have that let's define private static string as

  • 00:05:08 our source directory Okay, so my source directory will be here, my static source there are you

  • 00:05:19 see a lot of different files.

  • 00:05:24 So I will give this as my source.

  • 00:05:31 Of course, there will be type of images that cannot be converted to WebP.

  • 00:05:40 Okay like this, probably those would throw an error.

  • 00:05:46 Okay, so this will be our source directory.

  • 00:05:50 So where I want the output to be.

  • 00:05:54 I want output to be in desktop.

  • 00:05:58 So let's say converted images Okay, okay.

  • 00:06:05 You see you can make this totally, totally dynamic as well taking the source director

  • 00:06:21 from user with a directory picker and output director as well.

  • 00:06:32 But currently, I am not going to spend extra time for that.

  • 00:06:38 So first of all, we need to scan all of the images inside our source directory.

  • 00:06:45 Let's start with scanning the extensions, what kind of files we have in our directory.

  • 00:06:52 To that we are going to add using system dot IO, which is input output.

  • 00:06:58 And I'm going to use directory get files, though we will get source directory and our

  • 00:07:09 search pattern will be like this and search option will be all directory so it will also

  • 00:07:17 scan the let's say inner folders.

  • 00:07:24 So this will return you see a string array, which will include files, files, I'm going

  • 00:07:35 to put this inside another method so we can call it only one time private points, get

  • 00:07:43 file extensions Okay, so inside these files, we are going to get file extensions, we are

  • 00:07:53 file name and I think we can get file info or info equal to the file info which takes

  • 00:08:05 file name as this room is I think we can get extension of file for that tension here here.

  • 00:08:21 Okay, so which extensions to be have in our folders, I'm going to put that inside and

  • 00:08:33 I have said, okay, let's name it as let's just add it to the extension and we are file

  • 00:08:55 info dot extension is this a string or what?

  • 00:08:59 Yeah, this is a string.

  • 00:09:03 Okay.

  • 00:09:04 Then we will write it into a file file write all lines.

  • 00:09:13 Okay, and Pat will be found file extensions dot txt.

  • 00:09:20 So the content will be has extensions.

  • 00:09:23 Okay, however, since I have so many files, I would like to see the process.

  • 00:09:28 Okay, so let's add a first a label here.

  • 00:09:35 And I will name it as Libial process.

  • 00:09:38 And I will access this with a dispatcher.

  • 00:09:46 So let's also have static void set process label in our message.

  • 00:09:53 Okay, this will use Libial.

  • 00:09:58 Okay, you see, I am not able to access Libial process by in a static method because it seems

  • 00:10:05 it is in a main window and dispatcher begin invoke.

  • 00:10:11 Okay, this has some syntax that still I am not memorize it.

  • 00:10:20 So let's see the syntax from here quickly.

  • 00:10:26 Yeah, it takes action like this.

  • 00:10:33 Okay, so here Libial process dispatcher begin invoke new action.

  • 00:10:39 So this will set process content equal to as our message.

  • 00:10:45 So it takes a self executing action like this.

  • 00:10:48 Okay.

  • 00:10:49 And for this to work, I need to have task factor.

  • 00:10:55 I need to start this.

  • 00:10:57 I mean, for my interface to be responsive, and fully and I need to start this process

  • 00:11:04 as a new task.

  • 00:11:09 Okay.

  • 00:11:11 Here I will call this method and the task.

  • 00:11:16 Okay, and let's have a counter zero.

  • 00:11:23 And as we read the pro the file so we can person each of the divider is equal to zero,

  • 00:11:33 we will update the label.

  • 00:11:38 So how many files we have?

  • 00:11:44 My account will be equal to level.

  • 00:11:49 We are fires counts to length since the single dimension array we can use length and message

  • 00:12:02 will be Okay, let's say it's fired.

  • 00:12:10 Okay, I'll count or let's say processes fire.

  • 00:12:16 File in for process person will be equal to as a counter.

  • 00:12:32 Okay.

  • 00:12:35 And zero over photo accounts, which is the file count.

  • 00:12:45 Okay, here.

  • 00:12:48 And then we can also display the person as Okay, where is the problem here?

  • 00:13:01 Yeah, the problem has to be like this.

  • 00:13:09 And the person will be equal to over file count.

  • 00:13:18 This ring and two persons.

  • 00:13:24 Yeah.

  • 00:13:25 So why do I use use dividers?

  • 00:13:30 Because if I don't use this, it would take a lot of CPU time to try update label too

  • 00:13:44 frequently.

  • 00:13:46 Okay, everything looks fine.

  • 00:13:48 Let's start without debugging.

  • 00:13:50 So it will run faster.

  • 00:13:52 Okay, it was already too fast.

  • 00:13:57 Every file is open.

  • 00:13:59 Let's see which kind of extensions we have.

  • 00:14:02 Okay, we have XLS, HTML, echo, HTML config.

  • 00:14:05 And okay, so this is a file format that we would like to process.

  • 00:14:11 So we are going to process PNG, GPX and these PNG you see it's a bigger case that PNG.

  • 00:14:25 So we need to lowercase them.

  • 00:14:29 And yeah, so PNG and GPX.

  • 00:14:31 That's it.

  • 00:14:32 No other file format.

  • 00:14:34 However, there is a case where I have animated PNG files, a PNG and the C web exit is not

  • 00:14:52 available to process animated pages.

  • 00:14:58 So I will also have I will have a exception for them.

  • 00:15:09 Okay, so I am going to commit this out because we already learned the existing file extensions.

  • 00:15:15 Now I can start coding.

  • 00:15:18 Okay, so call it so private void start processing.

  • 00:15:27 So what this method is going to do is first it will get all files in source directory.

  • 00:15:36 Let's also have list.

  • 00:15:38 Okay, string, lsd process allowed extensions.

  • 00:15:46 Well, let's also have them as a string.

  • 00:15:50 So the allowed extensions are GPX and PNG.

  • 00:16:03 Okay, I will bypass the other file formats.

  • 00:16:12 I can also convert GIF images, I think.

  • 00:16:17 So for GIF images, we need to use.

  • 00:16:22 Let's open the file folders.

  • 00:16:29 Okay, we can use GIF to WebP.

  • 00:16:33 Yeah.

  • 00:16:34 Okay, I am not sure which options they take.

  • 00:16:39 So we need to experiment with this before starting this experiment with it.

  • 00:16:47 Okay, so I have already my command GIF to WebP.

  • 00:16:57 Okay, example.

  • 00:17:05 So it takes options input file GIF and output file.

  • 00:17:09 Yeah, that's it.

  • 00:17:11 What else?

  • 00:17:12 The options are lossy, mixed queue float.

  • 00:17:15 Okay, I have queue float as 100 already in size.

  • 00:17:26 It uses lossy compression by default.

  • 00:17:56 Okay, we can also include this mean size and int.

  • 00:18:07 What is this?

  • 00:18:14 I think I

  • 00:18:28 will manually convert them.

  • 00:18:33 Okay, lossy, lose quality 70, mean size.

  • 00:18:44 Okay, what does this option do?

  • 00:18:53 I am not sure.

  • 00:18:55 Let's get some more information regarding that.

  • 00:19:04 Okay.

  • 00:19:06 Let's look for mean size.

  • 00:19:17 Actually, the option was like this, yeah.

  • 00:19:36 We can check the help page of WebP, which is, where was it?

  • 00:19:47 Kits repository.

  • 00:19:48 They have some mailing list perhaps.

  • 00:19:53 Here, yeah.

  • 00:19:55 So here, I already have asked a question here.

  • 00:19:59 So mean size.

  • 00:20:12 Okay, let's see.

  • 00:20:49 Okay.

  • 00:21:01 I see so we can use min size.

  • 00:21:04 Okay.

  • 00:21:05 This is not very important right now, so first we will scan all of the files.

  • 00:21:11 Okay.

  • 00:21:12 Like here's and then we will scan the files, let's say we are source files.

  • 00:21:21 We will scan the files in output direct directory.

  • 00:21:31 Alright so output directory we are target files.

  • 00:21:39 Okay.

  • 00:21:43 And this will use output directory.

  • 00:21:48 And then we will get which files are not processed.

  • 00:21:57 In order to do that we need to do a check.

  • 00:22:07 So this is an array so I will make this into a list so that I can remove them like this.

  • 00:22:12 And this will be also a list.

  • 00:22:22 Okay so I also need to have extra list yeah.

  • 00:22:30 Yeah so okay actually this doesn't have to be list.

  • 00:22:38 We are target files real paths.

  • 00:22:48 So this will be we are target files dot select here replace sr output directory this.

  • 00:23:03 So what will this do?

  • 00:23:07 With this approach I will be able to compare which files are already processed or not.

  • 00:23:18 So our application will be able to restart.

  • 00:23:22 We are source files real paths okay it will be like this.

  • 00:23:38 Okay and then we are going to have this okay.

  • 00:23:51 Okay and we are files to process.

  • 00:23:54 It will be we are target files paths and what was it accept yeah.

  • 00:24:12 Accept takes another enumerable list.

  • 00:24:18 So source and target yeah it will be like this.

  • 00:24:22 Okay then we will get it as it is okay.

  • 00:24:35 And then we will get this as select yeah.

  • 00:24:44 Okay source directory plus oh we don't need this yeah we don't need this okay.

  • 00:24:52 So now that we have obtained it our files we can use parallel for each.

  • 00:25:05 Okay so parallel for each has some special formats.

  • 00:25:21 Okay parallel for each it uses a source which will be this then it uses an action.

  • 00:25:34 I am not sure how was the format let me find it.

  • 00:25:43 So that we can have a multi threading yeah something like this.

  • 00:25:52 We also need a parallel option or pair options like this pair options dot or let's make it

  • 00:26:08 pair options key options okay the max degree of parallelism let's make it eight.

  • 00:26:18 I have 16 core CPU by the way and it will be enumerating inside your files to process

  • 00:26:25 okay.

  • 00:26:26 And inside this I will call another method private void um processing a file.

  • 00:26:39 It will take as our original path like this and I also need to provide the parallel option

  • 00:26:53 here your file name okay it will start this file as a new process yeah.

  • 00:27:06 By the way this may change so let's assign it to local.

  • 00:27:10 It should change yeah never mind it and here we are going to start a process command line

  • 00:27:28 process so it will use process not start so it takes file name arguments using okay.

  • 00:27:50 So process starts takes file name and in order to achieve that we need to also have an id

  • 00:28:01 so to have concurrency let's say private static let's make it as ir file counter will be zero

  • 00:28:17 integers and with each file we will have interlocket we will use interlocket method this is for

  • 00:28:33 achieving concurrency.

  • 00:28:35 Okay how we're going to do that is okay interlocket increment your file counters then let's define

  • 00:28:51 the file name file name will be equal to interlocket read file counters.

  • 00:29:09 I am thinking that can there be same file name actually instead of interlocket I will

  • 00:29:19 use a private locking object yeah yeah not this one let's also define it private static

  • 00:29:31 object okay obviously let's say lock for file name new object so I will lock this object

  • 00:29:43 to increment my file counter and compare it's file name lock okay lock file name file Okay

  • 00:30:14 it appears that I have forgotten to unpause the video so what I did is I have written

  • 00:30:57 a piece of code to test before that let me one okay sorry about this confusion what I

  • 00:31:08 did is when I have forgotten to unpause the video is simply I have coded a test button

  • 00:31:14 and the test button is using our original static file cmd and gif file cmd and I also

  • 00:31:27 fixed something in gif file cmd which is I have removed the loses command because it

  • 00:31:34 was giving an error now they are working I am using a wait for exists so let me show

  • 00:31:40 you how it works okay okay let me start test so the first process is started it is taking

  • 00:31:52 some time because that image is pretty big then it is starting the other one and now

  • 00:31:58 they are generated okay so you see original file is 820 kilobytes and let's see how much

  • 00:32:07 did we gain okay so 820 minus 572 over 820 you see 30 percent gain we have in this file

  • 00:32:21 it is significant and it has zero difference how

  • 00:32:30 can I be so sure about that we can be sure about that with a comparison okay so I am

  • 00:32:38 going to only make a single line of single pixel of difference here on this web p file

  • 00:32:47 and I will save it as a test on my desktop here as a png so I will name it as test to

  • 00:32:56 png okay and then I will save my original file as test png on the desktop here then

  • 00:33:07 I will use online comparison website let me show you compare image difference okay there

  • 00:33:17 are several pages for that so first try with diff checker diff checker is awesome website

  • 00:33:23 believe me okay so when I see check the difference there is a single line of difference here

  • 00:33:30 on this image so how they achieve this I wonder yeah so here when I hover and when I zoom

  • 00:33:45 in okay like this you see there is a single line a single pixel of difference here and

  • 00:33:53 no other differences it is exactly same and let's compare with another website okay online

  • 00:34:06 diff so first image and the second image so I will make the fuzziness zero and it will

  • 00:34:15 show as a red color okay so on this image there is a single pixel difference here which

  • 00:34:22 is what I have made and there is no other red dot okay so I can copy this image to zoom

  • 00:34:30 in so you see there is no other red dot because they are exactly same except the single line

  • 00:34:40 single pixel that I have made myself so basically we gain 35 percent 30 percent size in this

  • 00:34:51 image and on this gift image we gained from minus to 26.9 over this 35 percent you see

  • 00:35:09 with on the gift image we gain 35 percent and let's test if they are working or not

  • 00:35:17 so this is our WebP GIF and this is our iponic GIF this is original GIF file and this is

  • 00:35:28 WebP file they are looking pretty much same to me we can also use some online websites

  • 00:35:41 online GIF to WebP there is one website which I have found working very well this one or

  • 00:35:50 yeah let's try this I think it was this one so let's open our debug test so here our GIF

  • 00:36:04 upload it then you see there is losing compression mixed compression I unmark them and convert

  • 00:36:13 the WebP so this website generated a little bit higher kilobyte because probably it is

  • 00:36:20 not using the best compression and that's it okay so we are able to properly convert

  • 00:36:29 GIF and static PNG and probably GPX as well we haven't tested GPX so let's also test the

  • 00:36:38 GPX for example yeah this wallpaper it's pretty big so it will probably take a lot of time

  • 00:36:54 okay let's copy and paste this okay so I will remove this probably we don't even need it

  • 00:37:10 right now what is the file name it is this I am not sure if it if it can produce better

  • 00:37:21 than GPX because GPX is already losing compression as you know okay let's try it so all processes

  • 00:37:36 started at the same time because we are not waiting them and they are running right now

  • 00:37:45 as they get completed it will close the window and why it takes so long is that we are using

  • 00:38:00 the best possible algorithm and let's see the output okay so yes the WebP file is bigger

  • 00:38:11 than the original GPX it is because GPX is already losing and when I save this GPX as

  • 00:38:22 a PNG let's see the size okay size of the PNG is this we can of course optimize it a

  • 00:38:33 little bit more with PNG out win and I am pretty sure there will be still significant

  • 00:38:41 difference between PNG version and WebP version this is a software that I have purchased to

  • 00:38:49 optimize my PNG files previously but it is not anymore necessary because now we can use

  • 00:38:57 WebP format which is much better format okay so this software is single threaded on a single

  • 00:39:10 image so it is taking some time it has so many passes okay so the optimized PNG file

  • 00:39:19 is 2.53 megabytes and minus 1.52 megabytes over or not this one actually since GPX files

  • 00:39:35 are already losing we shouldn't convert them to WebP probably we we cannot we cannot achieve

  • 00:39:48 same quality I wonder if there is an losing but no point of converting GPX into WebP let

  • 00:40:01 me check that first okay okay same quality for GPX I think we need to have some losing

  • 00:40:43 compression probably for GPX compression we need to use some other methodology so let's

  • 00:41:52 see which which options we can use okay let's see okay so there is version loses near loses

  • 00:42:23 int so we can use near loses for GPX I think okay so which which option should we use I'm

  • 00:43:08 not sure I think I will try near loses

  • 00:43:22 yeah let's try it with so for that I'm going to have another file it will be for GPX for

  • 00:43:36 GPX I'm going to remove loses and change it with near loses with zero and I think I have

  • 00:43:56 to remove z9 as well so yeah I have to remove z9 okay let's try this way for GPX okay and

  • 00:44:22 this is the file name okay let's test GPX SR or a GPX and let's comment out this is

  • 00:44:47 and let's make it like this yeah okay let's see what kind of results we are going to get

  • 00:45:01 with GPX command

  • 00:45:20 okay so it is done oh wow now we have a better result than original GPX so let's compare

  • 00:45:32 two images quality of course I am not expecting them to be same yeah I can see the difference

  • 00:45:40 there is already some difference but I am not sure if we have lost some quality or not

  • 00:45:58 yeah we have lost some quality as you can see definitely and it is not small as well

  • 00:46:11 okay I wonder if it is possible to compress GPX losing quality is this even possible I'm

  • 00:46:48 not sure compress GPX okay okay So, what happens if we modify our command file

  • 00:47:48 options for GPX such as this.

  • 00:47:53 Let's test it.

  • 00:47:56 I have to restart the application because it is reading that cmd file at the beginning.

  • 00:48:04 That quality loss files are significant when we zoom it in.

  • 00:48:10 We have lost a lot of quality.

  • 00:48:25 Here are GPX and here are PNG.

  • 00:48:29 By the way, when you convert GPX to PNG, you don't lose any quality.

  • 00:48:35 So, they are exactly the same.

  • 00:48:40 And when we convert WebP with losing compression, okay, now it is bigger than that and we probably

  • 00:48:50 even lost some quality.

  • 00:48:53 Wow, it looks almost the same.

  • 00:49:00 Yeah, looks like this has fixed the problem.

  • 00:49:04 So, if we make it 90%, probably we can get almost the same.

  • 00:49:16 Let's zoom the same, yeah, looks pretty much the same to me.

  • 00:49:25 Yeah, almost kept everything, however, it is still over the original GPX, so we can

  • 00:49:31 make it something like 95%.

  • 00:49:35 Let's try the 95%, okay.

  • 00:50:00 Little bigger than original GPX, so let's try 90% or this, where it is, here, okay.

  • 00:50:52 Okay, so 90% didn't make much difference.

  • 00:51:02 Okay, so let's test with default settings.

  • 00:51:09 So, to do that, I'm just going to remove all these options.

  • 00:51:19 And I wonder what kind of result we are going to get.

  • 00:51:22 Okay, without those options, I think.

  • 00:51:28 Okay, it was so fast and it is now so small size, however, what kind of result we have?

  • 00:51:45 Wow, significant quality of loss, quality loss, okay, let me show you.

  • 00:51:55 For example, 1900 zoom, now you see how much detail we have lost, yeah.

  • 00:52:10 For example, here, we can compare the M words, M letter actually, okay, so let's zoom to

  • 00:52:22 same, you see, how blurry it looks when compared to this, so removing options doesn't help.

  • 00:52:38 Maybe let's make both of these 95%, I'm not sure which one of them is, really does make

  • 00:52:47 a difference, okay, still bigger than the original, so let's try 90% for both, okay,

  • 00:53:22 so here's still same, so let's try 85%, I'm not sure what kind of result we're going to

  • 00:53:43 get, wow, it is bigger than the original file.

  • 00:53:50 So maybe 80%.

  • 00:54:07 Let's move this and only keep this quality, wow, the size is suddenly got too small, okay,

  • 00:54:41 so let's make this 95%, oh no, let's make this 100% and remove near losses and see what

  • 00:55:00 happens, okay, so this is a decent size and let's have a comparison with original image

  • 00:55:14 quality, here, original image and here 100% quality, okay, from the first impression,

  • 00:55:25 they look pretty much same, so let's zoom in and see the quality, okay, 1000, 1000 here,

  • 00:55:43 okay, oh, I see the quality loss, you see, there is a loss of colors, yeah, when we zoom

  • 00:56:11 out, okay, it is not very much visible when we zoom out, though, still there is some loss,

  • 00:56:36 but I would say pretty insignificant, yeah, almost looking same, which has very good amount

  • 00:56:43 of compression, so let's zoom in the eye, zoom in like this, okay, here, yeah, I see

  • 00:57:06 some loss of colors, it is just the color tone is loss, I think, not the detail itself,

  • 00:57:28 let's also try online conversion and what they produce, so this is the original file

  • 00:57:44 and convert webp, so it has generated, I think, the same file as we have, this is the original

  • 00:58:06 file, wow, this also has kept colors, oh, this is weird, our algorithm changes the colors,

  • 00:58:19 but online didn't change them, wow, this is so wrong for us, yeah, okay, I still see some

  • 00:58:37 difference here, here and here, hmm, I see, so these two are the really different ones,

  • 00:59:04 okay, let's see, hmm, it is still not the same, okay, okay, okay, okay, okay, okay,

  • 00:59:38 okay, hmm, let's look for the options again, options, okay, okay, okay, okay, okay, okay,

  • 00:59:56 options Let's add this Let's add this alpha.

  • 01:00:13 I wonder if it will make any difference.

  • 01:00:26 Let's make alpha 100 So we are trying to lose as minimal as possible quality and achieve

  • 01:00:36 some Okay, it is probably same Okay, it is probably same Okay, it is probably same Okay,

  • 01:00:44 it is probably same Okay, it is probably same Colors are changing you see This is the original

  • 01:00:53 file and this is the WebP output Colors are changing you see This is the original file

  • 01:00:56 and this is the WebP output Okay, so let's add it Hello world This品牌語詞 invested

  • 01:01:17 western 挽回 挽回 挽回 挽回 挽回 挽回 挽回 挽回 挽回 挽回 挽回

  • 01:01:38 挽回 挽回 挽回 挽回 挽回 挽回 Okay, let's try this option.

  • 01:01:52 This is interesting.

  • 01:01:56 Is it generating height?

  • 01:02:01 No, it's not.

  • 01:02:05 Yeah.

  • 01:02:07 Let's

  • 01:03:09 also open this tab.

  • 01:03:12 Let's open this tab, features.

  • 01:03:17 I don't know if this is making any difference.

  • 01:03:37 The only option that makes change is actually this, near loss.

  • 01:03:50 When I make it, it increases the quality, processing time, but size as well.

  • 01:04:10 Yeah, taking a lot of time.

  • 01:04:48 They are almost same size, and let's see.

  • 01:05:03 So this is the original file.

  • 01:05:12 I see now you see colors are kept almost as same.

  • 01:05:20 Yeah.

  • 01:05:21 Pretty much similar.

  • 01:05:22 So if we reduce a little bit more the losses to 75% maybe we can get a smaller size yet

  • 01:05:32 almost same quality for GPX.

  • 01:05:44 Let's also have another test image to see if it is working or not.

  • 01:05:51 Okay, game wallpaper.

  • 01:05:55 So from here something big, for example.

  • 01:06:07 Let's try this one.

  • 01:06:09 Oh, this is PNG.

  • 01:06:12 So let's sort by size.

  • 01:06:16 Oh, I see this is the biggest file I have.

  • 01:06:20 I wonder where I have this.

  • 01:06:24 Yeah, now it is smaller in size yet probably very similar in quality.

  • 01:06:40 So let's open both and have 2000 zoom in.

  • 01:06:52 Let's make it 3000.

  • 01:06:55 3000.

  • 01:06:59 Wow, almost same.

  • 01:07:03 Yeah, pretty much looking same.

  • 01:07:08 There is still some difference.

  • 01:07:11 For example, this original and this is the other one.

  • 01:07:15 I still see some difference, though they're almost exactly same.

  • 01:07:23 So when I zoom in the eye like this.

  • 01:07:30 Okay, yeah, pretty much looking same.

  • 01:07:38 Yeah.

  • 01:07:40 Okay, I think we can use these settings.

  • 01:07:46 So let's test with our.

  • 01:07:50 Oh, this is our biggest GPX by the way.

  • 01:07:54 Let's test with another GPX.

  • 01:07:57 So this one.

  • 01:08:01 I have to close this open exam files by the way.

  • 01:08:06 Because I will be need to recompile.

  • 01:08:12 Okay, so I will change the name.

  • 01:08:27 Okay, where is it?

  • 01:08:39 We didn't change the output.

  • 01:08:54 No, we did.

  • 01:09:03 Oh, did it have a problem?

  • 01:09:17 Purple GPX and purple WebP.

  • 01:09:19 Wow, the software thrown error I guess.

  • 01:09:25 Okay, this is a file it is generating.

  • 01:09:32 What happened?

  • 01:09:36 Oh, here.

  • 01:09:43 Okay, it is lower in size.

  • 01:09:50 Let's compare image quality.

  • 01:09:52 By the way, these are very old images made by my players.

  • 01:09:57 So wow, almost looking same.

  • 01:10:03 I don't see any difference.

  • 01:10:04 Let's compare and I hear.

  • 01:10:09 Yeah, almost same.

  • 01:10:15 Okay, so now we have our settings.

  • 01:10:25 Now we can continue our programming.

  • 01:10:33 Okay.

  • 01:10:34 So what we are going to do is we are going to process non-processed files.

  • 01:10:49 And we have file name.

  • 01:10:51 Okay, let's we need to read file info.

  • 01:10:55 So to do that, let's use using.

  • 01:10:59 File info, my file equal to the file info from the source I entered plus I think.

  • 01:11:06 Yeah, with the original path.

  • 01:11:09 Okay, looks like file input is not implicitly disposable.

  • 01:11:15 So we just can use like this.

  • 01:11:19 And then if my file extension string.

  • 01:11:24 The lower.

  • 01:11:28 Is equal to ng.

  • 01:11:32 String.

  • 01:11:34 String sr content of cmd will be equal to.

  • 01:11:46 Or let's make it like this.

  • 01:11:49 Okay, or original cmd.

  • 01:11:53 Let's assign it to sr.

  • 01:11:59 Original.

  • 01:12:01 Topic cmd.

  • 01:12:05 Let's assign each of each one of them.

  • 01:12:08 I will use a switch actually.

  • 01:12:17 Okay, if list allowed extensions contains.

  • 01:12:20 Your file extension.

  • 01:12:24 And let's have a switch.

  • 01:12:25 Your file extension and.

  • 01:12:28 This will be png.

  • 01:12:31 Brick and original.

  • 01:12:34 md file will be like this.

  • 01:12:41 For gpx.

  • 01:12:43 It will be sr gpx file and.

  • 01:12:55 Post.

  • 01:13:00 Give.

  • 01:13:05 It will be original gif file.

  • 01:13:09 Yeah, okay.

  • 01:13:11 Alright, so there is still one problem that we need to solve, which is.

  • 01:13:20 Converting animated.

  • 01:13:22 Png file.

  • 01:13:24 So to do that.

  • 01:13:27 What we need to do is.

  • 01:13:29 We need to generate another folder.

  • 01:13:34 As.

  • 01:13:36 Output directory by the way output directory will be.

  • 01:13:43 Converted images.

  • 01:13:46 Like this.

  • 01:13:52 And output.

  • 01:13:53 Let's say as animated.

  • 01:14:00 Directory.

  • 01:14:02 It will be like this, yeah.

  • 01:14:05 Animated or let's say.

  • 01:14:09 Animated.

  • 01:14:11 Why I am going to have this folder because I want to.

  • 01:14:15 Save them in another folder than to process later manually.

  • 01:14:21 OK, then we will generate our.

  • 01:14:33 Exporting folders.

  • 01:14:34 To do that, first we need to generate files or directory.

  • 01:14:42 Create directory so directory will be.

  • 01:14:52 It may automatically create the directory I am not sure.

  • 01:15:14 Hmm.

  • 01:15:19 OK, let's try it and see if it is working or not.

  • 01:15:27 I'm not sure if it if it doesn't, we will have to generate folders.

  • 01:15:31 Manually, so this is our original CMD file.

  • 01:15:37 OK, string is our content.

  • 01:15:39 It will be equal to.

  • 01:15:41 I am string.format.

  • 01:15:44 So the format will be original CMD file, whatever it is.

  • 01:15:52 Then we will provide input.

  • 01:15:57 So input will be my file simply.

  • 01:16:00 Actually, I need to provide this path.

  • 01:16:04 Let's provide it like this, yeah.

  • 01:16:09 And then we will have target as our.

  • 01:16:15 Output.

  • 01:16:18 Directory plus.

  • 01:16:24 The original path, yeah.

  • 01:16:29 And then we will start process single file or we are already inside processing a file,

  • 01:16:37 so we will just.

  • 01:16:39 Start process start.

  • 01:16:41 About first, we need to write it, I'll write.

  • 01:16:47 All text, so the file name is.

  • 01:16:54 Here.

  • 01:16:58 Process start file name.

  • 01:17:02 It's our content.

  • 01:17:05 I also need to wait process here.

  • 01:17:08 That's equal to this.

  • 01:17:11 OK, then wait for exist and delete file.

  • 01:17:17 So our folder won't get.

  • 01:17:21 Filled up.

  • 01:17:23 That's it.

  • 01:17:24 Let's start with.

  • 01:17:33 Single parallelism.

  • 01:17:36 And which file we get.

  • 01:17:41 Oh, we didn't call this yet, so.

  • 01:17:47 Simply we will call as this.

  • 01:17:51 And yeah.

  • 01:17:52 So currently we are just testing our algorithm is working or not.

  • 01:17:58 So the original pet is abilities new XLS.

  • 01:18:04 It is directly on the folder, so file name is like this file extension is XLS.

  • 01:18:10 And since it is not inside a load extension.

  • 01:18:17 So we will do if check here, basically.

  • 01:18:24 Return.

  • 01:18:27 OK, so let's directly jump here.

  • 01:18:35 OK, so the file name is this one.

  • 01:18:45 It is inside pubicons.

  • 01:18:47 So our source directory plus pet.

  • 01:18:49 Yeah, it looks correct.

  • 01:18:52 Output directory that's pet.

  • 01:18:55 OK, so.

  • 01:18:57 What error did we have?

  • 01:19:00 One moment.

  • 01:19:04 OK, we have problem.

  • 01:19:10 Oh, I also need to provide as our source directory.

  • 01:19:17 Yeah, now it should work.

  • 01:19:20 OK, so this is the content.

  • 01:19:24 Let's check it out.

  • 01:19:25 Oh, this is the pet of the exam.

  • 01:19:28 Oh, it has double.

  • 01:19:33 I think this can cause some problem.

  • 01:19:36 Is interesting why it is written like that.

  • 01:19:50 Maybe it is because of here.

  • 01:20:00 Not source directory.

  • 01:20:05 Yeah, this is our working directory.

  • 01:20:12 Yeah.

  • 01:20:13 Now let's try again.

  • 01:20:15 So the content is, yeah, looking correct.

  • 01:20:21 OK, petting looking correct.

  • 01:20:24 So you see it should automatically generate pubicons folder.

  • 01:20:27 I'm not sure if it will or not.

  • 01:20:30 So let's start the process.

  • 01:20:34 OK, this process starts.

  • 01:20:38 No, I don't see the process or it is already completed.

  • 01:20:46 So let's check it out.

  • 01:20:51 No.

  • 01:20:52 So let's try again.

  • 01:20:58 OK, and now we should be able to see the CMD file.

  • 01:21:04 Let's see why this is not working.

  • 01:21:11 Error, cannot open output file, yeah.

  • 01:21:30 So I have to generate output folder.

  • 01:21:39 How am I going to do that is, yeah, let's try this way.

  • 01:21:57 I'm not sure if it will work or not, or not test.

  • 01:22:00 And let's see if the directory is composed.

  • 01:22:06 Yes.

  • 01:22:07 OK, this is working, then OK, started, exited.

  • 01:22:13 And our favicon is generated as PNG, yeah.

  • 01:22:18 So we have a problem with, yeah, I have to replace original path.

  • 01:22:30 How am I going to do that is, hmmm, bilbash, hmmm, yeah, yeah, yeah, yeah, yeah, yeah,

  • 01:22:59 yeah.

  • 01:23:01 I need to change its extension, how am I going to do that is, I think I can change its extension

  • 01:23:11 as replace extension with, yeah, this should work.

  • 01:23:35 And I just found another problem, so I will replace that, but not only that, I also need

  • 01:23:48 to remove extension, split, false, then we

  • 01:24:12 will add it to our file.

  • 01:24:18 File to process, how, like this, hmmm, I also need to remove, yeah, I need to remove original

  • 01:24:39 file path with source directory, hmmm, yeah, OK, so let's start with single threaded and

  • 01:24:54 let's see if our application is working or not, OK, we have a problem.

  • 01:25:01 So, if an extension is empty, hmmm, OK, so if there is no extension then we just need

  • 01:25:24 to bypass it, OK, so, OK, our modification started, yeah, yeah, yeah, yeah, yeah, yeah,

  • 01:25:59 yeah, yeah, yeah, yeah, yeah, yeah, yeah.

  • 01:26:17 ok file icons are finished so let's control our process code is working because we want

  • 01:26:34 our application to be continueable ok so we have target as these fab icons and images

  • 01:26:44 account icons yeah so here we get modified name as abilities new and if target contains

  • 01:26:54 we are going to edit so we are files to process contains all of these they should not ok 65

  • 01:27:04 thousand 129 and how many we have yeah so I think yeah it is continuing with account

  • 01:27:16 items so it has bypassed the file icons so it is working we can say that by the way we

  • 01:27:25 can also minimize this because you see it is taking our space so let's remove it and

  • 01:27:36 we also still have one more thing p-chart detect animated png how do we identify if

  • 01:27:51 it is animated png or not ok let's say c-sharp check if png is animated ok ok ok Okay, there

  • 01:29:31 is ImageMagicNet, I think it has some animated PNG checking.

  • 01:29:40 I also asked it some questions here, but...

  • 01:29:46 RPNG.

  • 01:29:49 Check if PNG is animated.

  • 01:30:01 This is PHP.

  • 01:30:08 Okay, there is ImageMagicNet, I think it has some animated PNG checking.

  • 01:31:15 This is how to find if PNG is animated.

  • 01:31:43 Why I cannot...

  • 01:31:45 Why no one has asked this question, I wonder?

  • 01:32:17 Okay, I think to figure it out, I will use... an extension, ImageMagicNet here.

  • 01:32:39 Okay, so I think we can install this.

  • 01:32:59 Okay, ImageMagicNet.

  • 01:33:13 Okay, let's look for...

  • 01:33:40 Okay, let's first test an animated image as...

  • 01:33:57 For magic collection, we need to add using magic.

  • 01:33:59 And I need to get an example animated image from my static folder images.

  • 01:34:12 Actually, I don't have that, so let's look it from my another website.

  • 01:34:26 Okay, and...

  • 01:34:31 I will just make a fake registration.

  • 01:34:49 Okay, so...

  • 01:34:55 For example, let's test this image as...

  • 01:35:08 Test, okay.

  • 01:35:13 So for this, I need to provide full path working directory plus test and...

  • 01:35:57 PNG, yeah.

  • 01:36:17 Yeah, I know the reason because I have to make it like this.

  • 01:36:30 Okay, and now...

  • 01:36:33 Number of images is one and here does it show channel count four.

  • 01:36:48 How can we find out whether it is animated or not?

  • 01:36:59 Okay, maybe this is not working.

  • 01:37:08 Let's look for another one, APNG.

  • 01:37:14 Animated PNG creator, let's look for this package.

  • 01:37:27 Let's get the report of this, where it is.

  • 01:37:36 Okay, this is hard to find.

  • 01:38:15 Okay, let's look for another one, APNG.

  • 01:39:00 Okay, let's look for another one, APNG.

  • 01:39:33 Okay, there is APNG.

  • 01:39:50 And this is so old.

  • 01:40:53 PNG CS.

  • 01:41:51 Is this the same thing here?

  • 01:42:21 Okay, let's look for another one, APNG.

  • 01:42:27 Okay, let's look for another one, APNG.

  • 01:42:33 Okay, let's look for another one, APNG.

  • 01:42:38 Okay, let's look for another one.

  • 01:42:41 Oh, there is an API for net imaging API.

  • 01:42:49 What does this do?

  • 01:42:57 Supported formats.

  • 01:43:01 Yeah, okay, it is supported.

  • 01:43:11 So how does it work?

  • 01:43:18 Let's install this ASPOS, okay.

  • 01:43:26 Here, let's install it.

  • 01:43:33 And how do we use it?

  • 01:43:43 Okay, there is a code like this.

  • 01:43:46 And let's see what does that generate for us.

  • 01:43:50 Okay, so I need to set ASPOS image using...

  • 01:44:00 Okay, I am giving compact.

  • 01:44:26 I wonder if it can read the...

  • 01:44:32 Okay, where is gg?

  • 01:44:42 Okay, it is loaded.

  • 01:44:45 So, okay.

  • 01:44:46 So you see it is showing the format right now as APNG image.

  • 01:44:49 However, this is pretty slow if you ask me.

  • 01:45:00 So does it show other things?

  • 01:45:02 I think there is page count, width head, timeout, vertical resolution.

  • 01:45:14 File format, yeah, file format is APNG.

  • 01:45:28 Okay.

  • 01:45:40 Yeah, probably I can't have that file format type.

  • 01:45:57 Okay, looks like my only option is using this to determine if it is APNG or not.

  • 01:46:07 So I will also implement that to my logic, which will be here.

  • 01:46:16 So in case of it is PNG extension, I will have extra code here and I will provide full

  • 01:46:25 path.

  • 01:46:29 Like this and if, okay, image.

  • 01:46:50 File format equal to APNG.

  • 01:46:54 You see there are also other types.

  • 01:46:56 It's pretty slow, but no way.

  • 01:47:01 Then I will save it to do another folder as...

  • 01:47:06 Like this.

  • 01:47:09 File not the same.

  • 01:47:15 Right, or copy, yeah.

  • 01:47:21 The destination will be like this, yeah.

  • 01:47:34 SR output animated directory, yeah.

  • 01:47:40 Although I am not sure if this will work or not.

  • 01:47:45 By the way, I also need to composites directory so...

  • 01:47:53 File info.

  • 01:47:58 PNG file info.

  • 01:48:07 Okay, so everything is looking like ready.

  • 01:48:16 So let's try it.

  • 01:48:25 By the way, I will change source directory for quick testing of APNG.

  • 01:48:32 It is inside trainers here.

  • 01:48:37 Wow, okay, it went inside MPC trainers.

  • 01:48:41 And currently I don't have any animated trainer here, so...

  • 01:48:55 I will get here some, I will pause a bit.

  • 01:49:00 Okay, now I have added some animated images to here.

  • 01:49:07 You see there are over 8000 items.

  • 01:49:12 So I am going to change source directory into MPC trainers.

  • 01:49:20 To test my APNG if it is working or not.

  • 01:49:27 And let's start converting.

  • 01:49:31 Oh, since I have connected it, it is stopped.

  • 01:49:43 So let's close this.

  • 01:49:46 Okay, let's also modify our process start.

  • 01:49:52 Start, minimize it.

  • 01:49:55 How can we start it, minimize it.

  • 01:50:05 Okay, so how do we start AMD, minimize it.

  • 01:50:14 Okay, there is new process, file name, arguments.

  • 01:50:31 Okay.

  • 01:50:37 I think this can work, yeah.

  • 01:50:43 So where do we start it, we start it here.

  • 01:50:47 So we have a process start info, that is like this.

  • 01:50:53 We don't have a working directory.

  • 01:50:57 You make it minimize it, then we use var my process.

  • 01:51:05 I will of course comment this out.

  • 01:51:08 Okay, now they should be minimized.

  • 01:51:12 Okay, still they are getting.

  • 01:51:17 You see, open it like this.

  • 01:51:28 Converted images.

  • 01:51:31 Okay, since it is root directory taking, it is being like a root directory like this.

  • 01:51:40 I mean not inside images and MPG trainers because we have changed the root directory.

  • 01:51:46 Okay, it is pretty fast, so we can just wait.

  • 01:51:55 I will close this window.

  • 01:52:01 And how much GPU is being used.

  • 01:52:07 Let's open task manager.

  • 01:52:10 Yeah, I am at 30% right now.

  • 01:52:16 I think I can even make it faster.

  • 01:52:22 Currently it is 8.

  • 01:52:28 Or single, let's check it out.

  • 01:52:34 Okay, max degrow parallelism is currently 1, so let's change it to.

  • 01:52:46 Let's make it 3.

  • 01:52:50 And let's see how much CPU do we use.

  • 01:52:56 Okay, now we are using 60.

  • 01:53:05 So there is still some space to increase max degrow parallelism like 5.

  • 01:53:14 Okay, and then.

  • 01:53:17 Okay.

  • 01:53:18 So we are able to utilize most of my CPU.

  • 01:53:37 Okay, and currently we are not able to see the process, so let's also see the process

  • 01:53:47 as well.

  • 01:53:49 If I can stop the application.

  • 01:53:52 Okay, so to be able to see how many files we have processed.

  • 01:54:01 I think we can use file counter.

  • 01:54:08 And yeah.

  • 01:54:12 And how many files we have to process.

  • 01:54:21 I think we can display it here, set this label and process it.

  • 01:54:33 This may not be 100% precise but it should work.

  • 01:54:42 Okay, by the way, since this is a special character, let's make it like this.

  • 01:54:52 Wow, so many files remaining.

  • 01:54:58 I think it is getting processed again and again.

  • 01:55:10 Yeah, we have a logic problem.

  • 01:55:15 Yeah, the logic problem is caused by this extension so we need to add it to our converted

  • 01:55:25 images as well.

  • 01:55:27 Now, when we restart.

  • 01:55:33 Oh, since it is not done yet.

  • 01:55:39 Anyway, I know that which images are converted or not, so I will just delete most of them

  • 01:55:50 because we don't need most of them.

  • 01:55:54 They are starting from like 15,000.

  • 01:56:08 So let's just delete them all.

  • 01:56:22 Okay.

  • 01:56:24 Okay, around 3000 is left.

  • 01:56:33 Okay, let's start converting.

  • 01:56:38 Okay, I should get into this.

  • 01:56:47 By the way, this image loading is also taking some time for sure.

  • 01:56:55 Alright.

  • 01:56:59 It's pretty fast because these are small sized images, so it is expected to be fast.

  • 01:57:20 You see they are getting written here.

  • 01:57:31 We can also compare their size, but we have that at the end.

  • 01:57:40 Let's open the last folder.

  • 01:57:45 I think it should have come already.

  • 01:57:52 But I still don't see it.

  • 01:58:01 Let's put a breakpoint here to see if it is working or not.

  • 01:58:14 I can't even put a breakpoint here because you see this is getting focused.

  • 01:58:21 Why it is not working?

  • 01:58:37 Wow, we might have a problem somewhere around here.

  • 01:58:47 Let's put a breakpoint here too.

  • 01:58:55 Oh, we have a problem here.

  • 01:58:58 This has to be.png,.gpx, and.gif.

  • 01:59:04 You see you may always have some problems.

  • 01:59:10 And now we have to restart.

  • 01:59:12 Okay, I also will do something else.

  • 01:59:15 C sharp command process is getting focused.

  • 01:59:19 I don't want that.

  • 01:59:21 Maybe it can be somewhere around here, let's see.

  • 01:59:33 Process start info.

  • 01:59:35 Okay, focus.

  • 01:59:36 Is there any focus or something?

  • 01:59:41 There is great no window here.

  • 01:59:42 Let's set this as cool I think.

  • 01:59:57 Default is false.

  • 01:59:59 Okay, now we should not see any window.

  • 02:00:03 Okay.

  • 02:00:04 Oh, why?

  • 02:00:05 Oh, it was fast.

  • 02:00:08 So now outputs are animated.

  • 02:00:11 Original path is this.

  • 02:00:16 And let's see if it is copied or not.

  • 02:00:22 And let's see.

  • 02:00:24 Yeah, yeah, very nice.

  • 02:00:29 By the way, this no window is not working.

  • 02:00:38 Wow, it is just too fast.

  • 02:00:47 So here's great no window didn't work window style.

  • 02:00:53 What style there are hidden.

  • 02:00:55 Oh yeah, I will use hidden.

  • 02:00:59 Let's return back to our original path.

  • 02:01:04 Like this.

  • 02:01:07 Okay, wow, I don't even see the window right now.

  • 02:01:14 Hidden window is nice.

  • 02:01:15 And now I am able to even utilize weather.

  • 02:01:19 You see my Kaspersky is also taking a lot of CPU.

  • 02:01:24 But you see with no window, I'm able to utilize much more of my CPU.

  • 02:01:34 And I have converted images as well.

  • 02:01:37 Okay, now I will extract it again.

  • 02:01:43 Let's just delete all converted images.

  • 02:01:47 And let's delete animated images as well.

  • 02:01:52 And from download I will delete this too.

  • 02:02:18 And okay, delete that too.

  • 02:02:20 So let's extract here.

  • 02:02:25 Okay, pretty much our software is ready.

  • 02:02:32 I think it will work without any error right now. .gpx.png.gif We have switch.png.gpx.gif

  • 02:02:40 And we are having to lower method as well.

  • 02:02:47 By the way, I need to use lower with new system culture info.

  • 02:02:58 And us.

  • 02:03:01 Okay.

  • 02:03:04 So first let's test this.

  • 02:03:09 Oh, I also need to change this because now it is inside a single folder.

  • 02:03:19 Probably.

  • 02:03:22 Yeah.

  • 02:03:24 And let's test.

  • 02:03:28 Okay, so it is working.

  • 02:03:34 Now I will start without debugging to even optimize faster.

  • 02:03:40 Okay, and now we can watch our converted images with inside correct folders.

  • 02:03:52 Then we can compare folder sizes to see our gain.

  • 02:03:58 We can also see the process like this.

  • 02:04:09 Let's see how much CPU we have.

  • 02:04:11 We are pretty much utilizing all of my CPU and vpf application.

  • 02:04:19 Yeah, now the processes are being also shown inside vpf application since it is starting

  • 02:04:27 them.

  • 02:04:28 You see cweb, main window, command line, console window.

  • 02:04:35 Okay, five icons are done.

  • 02:04:40 Let's see how much bytes it is.

  • 02:04:43 So it is 988 kilobytes.

  • 02:04:47 Let's check the original size.

  • 02:04:52 It is 1063 bytes to be exact.

  • 02:05:02 So let's compare them.

  • 02:05:06 Minus.

  • 02:05:08 Okay.

  • 02:05:09 Actually, let's try it.

  • 02:05:17 Find out our data saving with keeping same quality.

  • 02:05:23 By the way, for PNG, we are using lossless.

  • 02:05:27 Wow, it is almost 40% probably.

  • 02:05:33 Okay, so this should work.

  • 02:05:42 It didn't work.

  • 02:05:44 Why?

  • 02:05:46 Oh, okay.

  • 02:05:48 36%, we have got 36% bandwidth save with this approach.

  • 02:05:58 For example, this is also done.

  • 02:06:03 And when you use parallel for each, it doesn't follow the exact order of items inside that

  • 02:06:15 list.

  • 02:06:16 So it will get updated.

  • 02:06:20 I mean, it's order will be different.

  • 02:06:24 Okay, now this can work until morning because it will take a lot of time.

  • 02:06:30 I'm going to end the video here.

  • 02:06:33 I hope that you have enjoyed.

  • 02:06:39 So this application will solve my problem currently.

  • 02:06:44 So far, I have failed to find a solution to programmatically convert APNG into WebP.

  • 02:06:59 So I will use this website to convert them because this website is working.

  • 02:07:08 Yeah, to manually convert, but I am looking for answers.

  • 02:07:12 For example, I have asked it in MagicNet GitHub.

  • 02:07:22 Here, they have a discussion forum here.

  • 02:07:30 You see, I have asked this, but no answers yet.

  • 02:07:38 I'm looking for a solution.

  • 02:07:42 Actually, the Google is even Google is not supporting that.

  • 02:07:47 So you see we are using currently we are using C Web.

  • 02:07:57 However, C Web is also not supporting APNG.

  • 02:08:05 I have asked it in their forum as well.

  • 02:08:11 Which is that you find here map mailing list.

  • 02:08:19 I have asked how to convert animated.

  • 02:08:26 So still no easy solution.

  • 02:08:33 Since I don't have that many APNG, I plan to convert them.

  • 02:08:38 With this website, but probably it supports here it supports on a single image at a time.

  • 02:08:48 It may take some time for me to fix it.

  • 02:08:56 So I need a programmatic way.

  • 02:08:59 The command says that I can extract them with APNG this, but I will check it.

  • 02:09:13 OK, end of the video.

  • 02:09:16 I hope you have enjoyed.

  • 02:09:18 See you later.

  • 02:09:20 You can also ask me any questions through our Discord channel.

  • 02:09:24 I will post my Discord channel link in the description of the video.

Clone this wiki locally