Convert to animated gif, transparency does not re-emerge - terminal

I am making an animated gif.
This gif is 50 frames or so and it contains quite some transparency.
The problem is that when transparency is to reemerge in the gif, it doesn't and instead continues to display whatever color was at that given pixel before the transparency was to appear.
How can i make the animated gif showing transparency when the given pixel becomes transparent?
Below is the terminal command i use to create this flawed gif.
convert -delay 5 -loop 0 pics/1.gif pics/2.gif animation.gif'

You apply the 'dispose background' option.
see: http://www.imagemagick.org/Usage/anim_basics/

Related

FFMPEG Wipe transition one layer over another

How to reveal one layer over another with a wipe transition using FFMPEG?
NOTE: this is not a slide transition. The top image stays in one position but is gradually revealed over time.
I'd like a technique that can work for top layers with or without transparency and for images, videos or dynamically created sources, like showwavespic.
I tried making a mask animation like so:
but alphamerge doesn't work as I expected it to and I can't find a blend mode that works with this type of mask.
EDIT: The xfade filter was suggested but it doesn't seem to work with when source has transparency. It renders transparent areas black. Example with transparent source:
But xfade renders this:
ffmpeg -loop 1 -t 5 -i flower.jpg -t 5 -loop 1 -i gear.png -filter_complex "[0]format=rgb24,drawbox=thickness=fill,split[black][black2];[black2]negate[white];[black][white]xfade=transition=wiperight:duration=1:offset=0[alf];[0][1]overlay=format=auto[ovr];[ovr][alf]alphamerge[fg];[0][fg]overlay=format=auto,format=yuv420p" output.mp4
format filter will allow drawbox to make true black color. Otherwise it may make a semi-transparent overlay as in the example GIF where you can barely see though the gear (I didn't notice when I initially made it). If you want YUV instead of RGB use yuv444p for example instead of rgb24.
drawbox covers flower.jpg with black. Alternatively you can use the color (and optionally scale2ref) filters. This is a lazy way to make a black image the same size as the input.
split filter makes a copy of the black image and negate filter makes the copy white.
xfade makes an animated alpha mask from the black and white images.
alphamerge adds the alpha mask to the output from overlay.
The resulting overlay with alpha is overlaid over flower.jpg.
Also see
FFmpeg Filter Documentation
FFmpeg Wiki: xfade for a gallery of transition effects.

Delphi XE7 - Make PNG image transparent inside Form

I set the Form Color to : clFichsia and TransparentColor: True and TransparentColorValue to : clFuchsia.
I need to remove the clFuchsia color from the Form.
Normally the image is transparent but when i load it in the application
the color of the Form doesn't disappear.
How my application looks like:
There are two different ways to handle transparency:
1) the old simplified (Windows/Delphi) way, where a specific RGB color is made transparent. This method does not allow any partial transparency (opacity is either 0% or 100%).
2) the "new" way, where you use an image with an alpha-channel, e.g. a PNG image. Each pixel has an opacity value in addition to the RGB value, which allows partial transparency (e.g. for anti-aliasing).
You are mixing those two methods. You load a PNG image with an alpha channel (method 2), but then you also set a transparent color (method 1). And the reason it looks that bad, is because the "fuchsia" RGB value in your image is not exactly the same everywhere.

How to use gif image inside html5 canvas?

I've been searching all day to use gif image inside html5 canvas can't find a useful article in it,is there any way I could use gif image inside canvas. I'm in position to use a gif image inside a canvas but it doesn't changes it loads loads the first frame only and how to play the gif image completely or is there any way I could use gif formatted image inside a
canvas.
Quote from jsgif: A GIF player in JavaScript
Unfortunately, the DOM doesn't expose individual frames of a GIF, so
this is done by downloading the GIF (with XMLHttpRequest), parsing it,
and drawing it on a .
Maybe you would take a look in the jsgif source code to find some ideas

Image processing - TIFF images in Matlab in grayscale

In Matlab, when I use
imshow('trees.tif')
it displays an RGB image, but when I use these two functions
I=imread('trees.tif')
imshow(I)
it displays a gray scale image, and it's still the exact same image.
This only happens with TIFF images, because when I use it for a JPEG image like so:
I=imread('flower.jpg')
imshow(I)
it displays an RGB image, and it's the same thing as imshow('flower.jpg').
Can anyone please explain why the use of imread/imshow on TIFF images displays them in gray scale?
Load the color map too:
[I,cmap] = imread('trees.tif');
Display it with the map:
imshow(I,cmap)
Convert it to RGB:
Irgb = ind2rgb(I,cmap)
So you can display and manipulate it without the colormap:
imshow(Irgb)
imagesc(Irgb)
% etc.
Eye candy:

Resizing a png image without losing tranparency

I am trying to save a png file in database using C#.
Bitmap thumbnail = new Bitmap(file.InputStream);
thumbnail = ImageUtilities.ResizeImage(thumbnail, Convert.ToInt32(width),Convert.ToInt32(height)); ImageUtilities.SaveJpeg(path,thumbnail,Convert.ToInt32(Resources.AppConstants.ExtractThumbnailQuality);
The image gets saved in database, but with a black background around the image. In short, it loses its transparency.
If I skip the resizing of image, instead of black background, a white background appears around the image.
Can anyone suggest, how to preserve the tranparency of the image
You are saving the resized image as JPEG. JPEG does not support transparency. Save it as PNG instead

Resources