Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411516 Posts in 69380 Topics- by 58436 Members - Latest Member: GlitchyPSI

May 01, 2024, 09:34:23 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Importing animated gif (pixel art) into flash
Pages: [1]
Print
Author Topic: Importing animated gif (pixel art) into flash  (Read 3818 times)
rayteoactive
Level 1
*


View Profile WWW
« on: April 23, 2010, 07:34:33 PM »

I'm a little intimidated to post these amateurish question here, but I'm not a programmer, and the other flash base forum doesn't really have an idea about this.

Anyway, I was I'm working on my game in flash, I imported some animated gif into it, and some of the frames got distorted, while the rest came out right. I did this a couple times, and the same frame got distorted everytime.

Does anyone knows what might have caused it? and how we can avoid this?
Here a sample of how it looks, and how it's supposed to.

I tried this in both CS3 and 4, both didn't quite worked out right.
Here's the gif, and how it came out in flash.


http://
Logged

ishlilith
Level 0
**


View Profile WWW
« Reply #1 on: April 24, 2010, 07:17:16 AM »

The gif is corrupted, shows badly in gimp, acdSee and everywhere except in the browser WTF
Try using another program? Or use a png, gifs are the spawn of the devil!
Logged

RayRayTea
Guest
« Reply #2 on: April 24, 2010, 07:42:23 AM »

Are you sure it's corrupted? I was able to see it in both file manager preview (I'm using DOpus) and in Pro Motion without any problems... anyway I opened it and resaved it from PM, even if there were some problems it should work now:

Logged
ishlilith
Level 0
**


View Profile WWW
« Reply #3 on: April 24, 2010, 07:53:47 AM »

Are you sure it's corrupted? I was able to see it in both file manager preview (I'm using DOpus) and in Pro Motion without any problems... anyway I opened it and resaved it from PM, even if there were some problems it should work now:



Yes, maybe the word is not corrupted but different implementation of the gif format or whatever, but it does not work.
And your version imports fine in flash

http://www.swfcabin.com/open/1272120869
Logged

rayteoactive
Level 1
*


View Profile WWW
« Reply #4 on: April 24, 2010, 02:58:14 PM »

Are you sure it's corrupted? I was able to see it in both file manager preview (I'm using DOpus) and in Pro Motion without any problems... anyway I opened it and resaved it from PM, even if there were some problems it should work now:



Yes, maybe the word is not corrupted but different implementation of the gif format or whatever, but it does not work.
And your version imports fine in flash

http://www.swfcabin.com/open/1272120869

Hmmm...? Strangely enough, when I re-save the gif from photobucket and import it into flash, and it worked. Yet, when I try it with my new gif saved in PS, the gif got distorted again.

Also, importing things in frame by frame as PNG, now the sprite looks blurish when zoom, it hurts. I'm hoping to zoom into the game at some point, so I'd be glad if there's any idea how we can remove the blur?

Still, importing the gif is still the most time efficient way to do this, and I still hope to find out the problem here.  Cry
Logged

kyn
Level 10
*****


View Profile WWW
« Reply #5 on: April 24, 2010, 03:14:08 PM »

Also, importing things in frame by frame as PNG, now the sprite looks blurish when zoom, it hurts. I'm hoping to zoom into the game at some point, so I'd be glad if there's any idea how we can remove the blur?

I may be mistaken, but go to Library, select the desired image, right click, Properties and disable Smoothing.
Logged
dustin
Level 6
*


View Profile
« Reply #6 on: April 24, 2010, 03:37:25 PM »

Also somewhat tricky is the fact that when you import it it imports it as a bitmap and also as a symbol I think.  If you look at the symbol the preview will be blurry but in game it won't be.  Kinda strange.  At least this happens to me in cs3
Logged
rayteoactive
Level 1
*


View Profile WWW
« Reply #7 on: April 24, 2010, 03:47:47 PM »

@Kyn - I've checked, but smoothing wasn't set to enabled to begin with

@Dustin - Actually, they got imported as bitmap and a "gif". The gif didn't turn blurry though. Just the PNG.

Oh, and 1 more question. For those that does flash game with pixel art, do you use spritesheet? Or do you create place them in stage with the animation frame by frame?
Logged

Bernie
Level 0
***



View Profile WWW
« Reply #8 on: April 25, 2010, 01:45:51 AM »

Copying images into a movieclip and drawing it to a bitmap will be a little slower than using a spritesheet and copypixel.  However, using draw() will enable you to use a matrix modifier, which you can use for scaling. And there's another modifier for setting alpha values.

I'm still a beginner, though. I may be wrong.
Logged

http://www.origamihero.com - freeware oldschool games |  gamedev twitter
ChevyRay
Guest
« Reply #9 on: April 25, 2010, 01:53:29 AM »

Copying images into a movieclip and drawing it to a bitmap will be a little slower than using a spritesheet and copypixel.  However, using draw() will enable you to use a matrix modifier, which you can use for scaling. And there's another modifier for setting alpha values.

Yeah, draw() also lets you pass in a ColorTransform object which you can use for basic color channel transformations, such as tinting and providing an alpha multiplier.

Quote
Oh, and 1 more question. For those that does flash game with pixel art, do you use spritesheet? Or do you create place them in stage with the animation frame by frame?

I use spritesheets for all animated pixel and painted art in my games, except the occasional special case.
Logged
rayteoactive
Level 1
*


View Profile WWW
« Reply #10 on: April 25, 2010, 02:13:57 AM »

Quote
Quote
Oh, and 1 more question. For those that does flash game with pixel art, do you use spritesheet? Or do you create place them in stage with the animation frame by frame?

I use spritesheets for all animated pixel and painted art in my games, except the occasional special case.

I forgot to ask, but what's the rational for doing so. Is it only because of the speed as Bernie mentioned??
Logged

ChevyRay
Guest
« Reply #11 on: April 25, 2010, 02:21:30 AM »

I just prefer to have my hundreds of sprites zipped up nicely into a few PNG sheets as opposed to in hundreds of different files. Then it only takes a single line of code to embed them, and then another line to pass that single reference into my sprite sheet handler classes and bam, all done. Saves me a lot of work and it runs fast, so I really wouldn't have it any other way. Smiley

Plus, also for other things, such as if I want to make a color modification to a sprite, I can just open up the PNG and change them all at once, as opposed to having to open up each file and change it, etc. etc.
Logged
nikki
Level 10
*****


View Profile
« Reply #12 on: April 25, 2010, 03:07:22 AM »

yeah but you are working with flashdevelop and flashpunk, (instead of that f%^#ng flash ide)

thanks Chevy, for that greatly structured lib.
- the first time ever i managed to write something in flash (as3+flashdevelop) and not be disgusted by the mess.
thanks
Logged
rayteoactive
Level 1
*


View Profile WWW
« Reply #13 on: April 25, 2010, 04:48:00 PM »

@ChevyRay
Took this from flashpunk tutorial Smiley

But anyway, like I was saying, I was hoping to get the pixel sharp zoom in effects, and I got this by "right-click - zoom in" in flash.

But what I keep getting instead, was the blurry version on the right. I messed around with the auto smoothing settings, but I couldn't tell if there was any different. I tried puting the same PNG in CS3, and it was sharp again. (I was using CS4)
Logged

ChevyRay
Guest
« Reply #14 on: April 25, 2010, 05:33:12 PM »

Have you tried just changing your root movieclip's scaleX and scaleY properties? Make sure that your movie quality is set to LOW and it should "zoom" without blur just fine. You'll have to manage the origin of the zoom yourself though.
Logged
rayteoactive
Level 1
*


View Profile WWW
« Reply #15 on: April 25, 2010, 06:54:11 PM »

Have you tried just changing your root movieclip's scaleX and scaleY properties? Make sure that your movie quality is set to LOW and it should "zoom" without blur just fine. You'll have to manage the origin of the zoom yourself though.
Sorry...I don't quite get what you mean. I'm just playing around with the graphics at the moment so I haven't convert them to movieclip. The graphics are placed such that they are not "in between a pixel", like X: 20.3 or anything like that. As for movie quality... I don't really know where to adjust that. You don't mean jpg quality now, do you?
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic