Hi,

> Hi all, I've been working on allowing users to dowload a jpeg from a 
> movieClip in AS2 and came up with a simple, yet novel 
> compression idea, 
> that's a bit like RLE but not quite.
> 
> Basically it is this - analyze the image pixel by pixel to 
> get the hex color 
> codes into an array. Then, make a new array the same length 
> as the colors 
> array, but filled with "" - so it's full of nulls. I then 
> iterate the colors 
> array and if the current color is the same as the previous 
> color, I don't 
> add it to the new array - otherwise I do.
> 
> So if I have: [ff, ff, ff, aa, ff, aa, aa, aa, aa] the new 
> array would be 
> [ff, , , aa, ff, aa, , , ]

you're sending a comma separated string to the server?

why not have 2 hey digits for all the data and omit the comma? this would
bring your data to 2/3 of its size, which means 26sec*2/3 = 17.3sec

when this works, you could try to send binary data - so instead if sending
the string "ff" you would send the binary byte 255. if this works, this
would cut the time in half again => 8.6sec

if you can't create binary data, you could still use base64 encoding
instead, which would give you 8.6*1.33 = 11.5sec.

regards

Claudius

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to