![]() ![]() ![]() Compress( "path ")įurther details about the result of the compression are also available on the Input and Output properties of a Compress operation. imageA.png is 220kb -> After -> 87kb / 62 reduction I have access to png 'compression' libraries like that, but the problem is that the ImageResizer bumps the size back up to full (without compression) imageA. or just save to disk await compressedImage. get a stream instead var stream = await compressedImage. you can then get the bytes var bytes = await compressedImage. If you want to actually save this compressed image off // it will need to be downloaded var compressedImage = await compressImageTask. or `CompressFromUrl` if compressing from a remotely hosted image. Compress( "pathToFile or byte array or stream ") this gives you the information about your image as stored by TinyPNG // they don't give you the actual bits (as you may want to chain this with a resize // operation without caring for the originally sized image). Optimize PNG, JPEG images quickly using these tools. create an instance of the TinyPngClient using var png = new TinyPngClient(" yourSecretApiKey") Best TinyPNG alternatives that you can use to optimize your images before uploading them to your site. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |