Converting animated .gif file into a .bmp strip

2019-04-16 17:04发布

I was wondering if someone can direct me or guide me in order to use a .gif image and convert it into a .bmp strip image file.

4条回答
▲ chillily
2楼-- · 2019-04-16 17:38

Just load .gif in Bitmap and save it in .bmp. If you want to export the frames of .gif I have no idea how to do this. You can have look at this www.eggheadcafe.com/articles/stripimagefromanimatedgif.asp, it seems to be what what you're looking for.

查看更多
该账号已被封号
3楼-- · 2019-04-16 17:40

Making an image strip can be easily done with Photoshop (you can get a free trial version, or Elements)

  1. Open .gif - Photoshop will open each frame as a layer
  2. Resize canvas to (height of the gif * layers) pixels
  3. Remove all frame information, keep layers
  4. Select last layer, and move it to very bottom
  5. Select all layers and click 'Distribute vertical centers'. Now you have a perfectly arranged strip.

If you are using Photoshop, you can just export as BMP. Thats it.

查看更多
一纸荒年 Trace。
4楼-- · 2019-04-16 17:47

The method what works for sure is:

  1. Download an install Easy GIF Animator
  2. Open tour gif with it and export the frames to separate files
  3. Download and install any program which can create the layers (eg. Photoshop CS3 Little)
  4. Create a new file width as your picture; Height = Height of Your pic. X number of pictures
  5. Copy each pic. as a layers in to Your new file and move them one after the other.
  6. Save it as a .png file
  7. Download an install iPAQ 31x Image Explorer
  8. Open Your .png in it
  9. Save it as aRGB file (normal BMP may don't work)
  10. DONE!!

Maybe it's not the easiest method but it gives the possibility of precise editing and allows you to make strips of icons that are on a transparent background (but not limited to icons)

查看更多
叛逆
5楼-- · 2019-04-16 18:00

First, you need to get the gif's size. Then you need to find out how many frames there are.

After that you need to create a new image with Height = original height, and Width = Frames * Gif Width.

Then you must paste the original Gif's frames into the strip like so: Frame N starts at pixel N*Width.

That is if you're making a horizontal strip.


And here is the complete code for a console application:

using System.Drawing;
using System.Drawing.Imaging;

foreach (var arg in args)
    {
        Image gif = Image.FromFile(arg);
        FrameDimension dim = new FrameDimension(gif.FrameDimensionsList[0]);
        int frames = gif.GetFrameCount(dim);

        Bitmap resultingImage = new Bitmap(gif.Width * frames, gif.Height);

        for (int i = 0; i < frames; i++)
        {
            gif.SelectActiveFrame(dim, i);

            Rectangle destRegion = new Rectangle(gif.Width * i, 0, gif.Width, gif.Height);
            Rectangle srcRegion = new Rectangle(0, 0, gif.Width, gif.Height);

            using (Graphics grD = Graphics.FromImage(resultingImage))
            {
                grD.DrawImage(gif, destRegion, srcRegion, GraphicsUnit.Pixel);
            }
        }

        resultingImage.Save("res.png", ImageFormat.Png);
    }

The resulting image is saved in the compiled console app binary file directory under the name res.png. You can make the app save the resulting image right where the source file is, ask whether to make a horizontal or vertical strip, etc.

查看更多
登录 后发表回答