How to make the image transparent?

I have two images:

First

http://www.eurocopter.in/contest/images/loader33.gif

Second

animated-web-preloader.gif

If you see that the first image has no background. So the background looks white. The second image has a black background.

  • Question 1: What do we call the first type of image?

  • Question 2: How to make this type of image?

  • Question 3: How to convert the second type of image to the first type of image?

+6
source share
2 answers

These are animated GIF files, the first with a transparent background. You can split the image into separate frames using ImageMagick (installed on most Linux distributions and available free of charge for OSX and Linux) as follows:

convert -coalesce type1.gif frame%02d.gif 

which will provide you with the next 18 frames as separate images

 frame00.gif frame04.gif frame08.gif frame12.gif frame16.gif frame01.gif frame05.gif frame09.gif frame13.gif frame17.gif frame02.gif frame06.gif frame10.gif frame14.gif frame03.gif frame07.gif frame11.gif frame15.gif 

frame00.gif

enter image description here

You can see them all at once if you make them as montages as follows:

 convert -coalesce type1.gif miff:- | montage -tile x4 -frame 5 - montage.gif 

enter image description here

You can find information about each frame, for example, about its size:

 identify type1.gif type1.gif[0] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[1] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[2] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[3] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000 type1.gif[4] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[5] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[6] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000 type1.gif[7] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[8] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[9] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[10] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000 type1.gif[11] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[12] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[13] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[14] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000 type1.gif[15] GIF 100x100 100x100+0+0 8-bit sRGB 64c 29.2KB 0.000u 0:00.000 type1.gif[16] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 type1.gif[17] GIF 100x100 100x100+0+0 8-bit sRGB 128c 29.2KB 0.000u 0:00.000 

You can put all the frames back together as follows:

 convert frame* -loop 0 -delay 20 anim.gif 

enter image description here

You can try to remove the black background from the second to make it more similar to the first using this command. You may need to play a little with the fuzz coefficient:

 convert type2.gif -fuzz 15% -transparent black new.gif 

enter image description here

+7
source

Yes, you can, you should use some kind of photo editing software such as Photoshop, try to follow the steps in this guide, let me know how this happens.

How to create a transparent GIF in Photoshop

+2
source

Source: https://habr.com/ru/post/985770/


All Articles