Compress GIF image without loosing animation - c#

I am compressing images by reducing height and width to reduce their size and it works fine for images that don't have animation but if I do this for animated images, it will reduce the size but loose animation as well. I haven't tried anything till yet as I couldn't find any solution online. Any Idea?

Related

Drawing wide image in Xamarin.Forms Android

I'm having a bit of an issue getting an image (size 1.25MB, resolution 1080 height by 2520 width) to run on my android emulator. I can't figure out why resolution does this, but I'd like to preserve as much details as possible. So far I've tried:
Moving the image to different mipmap folders (no effect, image doesn't even get displayed and if drawable is say 120x480, that will be displayed, mipmaps don't work as source AT ALL for some reason).
Turning of hardware acceleration in manifest.xml (I'm assuming that's not a desired practice for release app). That works however the whole emulator gets really laggy.
Compressing image to smaller sizes. Still getting "trying to draw too large of a bitmap" error.
Any help would be appreciated!

Why image has different pixel resolution in Hololens

I'm working on application, where small UI.Images are displayed with small textures 32x32 pixels. It is very important to display each pixel properly.
When I'm trying to launch the application in Unity everything is perfect - Image consists of 32x32 pixels.
While deployed to Hololens, the Image has worse quality and resolution changes to 16x16 pixels.
The question is how to obtain texture displayed in 32x32 pixels quality on Hololens device?
Ok, finally I figured it out. In Unity Edit > Project Settings > Quality the option Very Low is used for Hololens application. In this mode the Texture Quality is set to Half Res, thus the Image was rendered with half of the pixels' number (16 pixels). When changed to Full Res, the Image get original 32 pixels size.
It does not explain why in Unity Editor the Image was displayed properly, but the most important thing is that now it's working properly on the device.

Import/Setting background image to windows form cause run slow

I import background image to every forms in my project now my programs runs slow?
How can I fix this?
the format for the image is png.
Any things to consider in to doing this? to solve the issue? thanks!
In your Form,set property DoubleBuffered to true
Buffered graphics require that the updated graphics data is first
written to a buffer. The data in the graphics buffer is then quickly
written to displayed surface memory. The relatively quick switch of
the displayed graphics memory typically reduces the flicker that can
otherwise occur.
Instead of using PNG format use JPEG format with Quality 12(final image quality is like PNG format),your image size decrease and your form load faster.

Content-Aware Image Cropping with C#

I am working on a CMS like project which users can upload images with contents. I have to create thumbnails for the uploaded images on the fly. Lets say the thumbnail size as 125x75
I can resize images without problem but when it comes to crop operation several problems occur. My resize and crop procedure works like this:
Load the original image.
Resize the image to desired size preventing the original aspect ratio depending on the given maximum width or height
If the result image has a different aspect ration than the output aspect ratio than a centered crop operation is applied.
But what I want to achive is a content-aware cropping as described in Jue Wang's article Opticrop: Content-aware Cropping with PHP and ImageMagick
Is there any way to do it with C# or is there a library that can do this operation.
Note: I do not want content-aware resizing. Content-aware resizing (seam craving) can be done with ImageResizing.net SeamCarving plugin
If you are using the ImageResizing.net framework, the WhitespaceTrimmer plugin may be a good starting point I think.
If you want to write the code yourself, this Gist shows a good solution using entropy but is written in Ruby.

Does WPF embed full size image into output?

I have a WPF application that includes buttons with PNG images. The actual images get scaled by grid control inside the button to about 32 pixels or so (depending on button size). At the same time my original artwork created in Photoshop is 250x250 pixels in size.
Currently I create artwork in Photoshop, add it to my WPF project as a resource, and have WPF automatically scale it to the button size.
Here's my question - if my original image is 250x250 pixels, and WPF squeezes it into a button so that it is only 32x32 pixels, does my output file contain the 250x250 image, or the 32x32 image?
I'm asking because if the app performance is going to be negatively affected by the original image size, I'd rather just scale it in Photoshop myself.
Yes, it will include the full file, because it can't recognize that it might not be shown larger at runtime. You can check this by decompiling your program using ILSpy.

Categories

Resources