Can somebody help me?

I have a divx movie that i want to modify in some parts on a frame level editing (painting on them), there is a way of extracting parts of the movie in a image sequence and than edit in a paint program. But how to put them back in the movie replacing the old parts, without damaging the movie?

Thanks