japng_android
japng_android copied to clipboard
Image read distortion
Hello! I used the source code you wrote, the images in the png format can be played, but image distortion,Where did the problem come from??? Best wishes Annie
Hi Annie, Can you post or link to sample images and, if possible, a screenshot of the result?
On Fri., 15 Jun. 2018, 09:47 A-Annie, [email protected] wrote:
Hello! I used the source code you wrote, the images in the png format can be played, but image distortion,Where did the problem come from??? Best wishes Annie
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7Eopik7GcaBUgBMTBHMO-4RJKGK5uDks5t8xI5gaJpZM4Uo5om .
链接:https://pan.baidu.com/s/1pZnEGLiVgmVf5PN-PBdUuA 密码:22wh Hi the sample image and result as url,Please find Annie
That link didn't come through properly. It appears to be https://pan.baidu.com/s/1pZnEGLiVgmVf5PN-PBdUuA but that page asks for a password.
It is better to attach directly to this issue thread. You can do that by dragging and dropping, or pasting from the clipboard.
A gentle reminder that this is an open source project run by volunteers. I'm happy to try to help, but you need to provide as much information and help as you can.
Hi I'm sorry for this , the url is https://pan.baidu.com/s/1pZnEGLiVgmVf5PN-PBdUuA password : 22wh Thanks
That gives a 404 not found. Please just attach the image directly.
On Fri., 15 Jun. 2018, 10:53 A-Annie, [email protected] wrote:
Hi I'm sorry for this , the url is https://pan.baidu.com/s/1pZnEGLiVgmVf5PN-PBdUuA password : 22wh Thanks
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-397498297, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7Eop3L7kPhxw2KiQi7Q8C3VFeTV7a1ks5t8yGQgaJpZM4Uo5om .
Hi aellerton Have you downloaded the picture? I'll delete it
Thanks, yes go ahead.
On Fri., 15 Jun. 2018, 11:41 A-Annie, [email protected] wrote:
Hi pictures as follow, and this is the first time to use github, Some are not very good. Sorry
[image: _20180615101800] https://user-images.githubusercontent.com/40282777/41448950-876422c0-7090-11e8-859c-f5bb57036e12.jpg [image: animate] https://user-images.githubusercontent.com/40282777/41448962-9c5a492a-7090-11e8-929e-3819c71bab63.png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-397504583, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7Eonhj0yWMDIyUXw2VZq4nf-oVAXOLks5t8yzRgaJpZM4Uo5om .
The good news is I can reproduce it. The bad news is that it looks like it's an issue in the blend modes between frames. The frames that look good use blend mode 0. The frames that look bad use blend mode 1. I have a feeling that blend mode 1 is not properly implemented yet.
@A-Annie Are you working from git directly or from the released version?
Hi,I download the source packet from github.I’m on holiday,will work on tomorrow,thank you for your help!!!
Great - when you are back, try pulling the latest master and let me know if it fixes the issue. The change is described in #3 (with thanks to @marcos-dogonahorse)
OK
Hi aellerton Did you change only PngAnimationComposer.java? I replaced the original file, but also appear the issue
Hi Annie, You don't need to replace files. Just do "git pull" in the repository, then rebuild.
Hi aellerton I downloaded the source locally,and I haven't the git tools,what happens when I replace the file?? Did you resolve the problem after update the file?
I see. Well, if you don't have git tools, just download the whole thing again, or download that the latest version of that file. Is that what you tried already?
On Tue., 19 Jun. 2018, 13:17 A-Annie, [email protected] wrote:
Hi aellerton I downloaded the source locally,and I haven't the git tools,what happens when I replace the file?? Did you resolve the problem after update the file?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-398277042, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EokxxCteNseNGWvElBhl3SiB7tqISks5t-IlzgaJpZM4Uo5om .
Hi ellerton I tried the latest version, the issue also happend...
Ok. I'll be able to look in more detail in a few days.
On Tue., 19 Jun. 2018, 16:06 A-Annie, [email protected] wrote:
Hi ellerton I tried the latest version, the issue also happend...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-398312017, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EopELXE2cqiW38iEjG5A4-_JLaN6Hks5t-LD0gaJpZM4Uo5om .
A workaround for the meantime: compose the PNG with full frames using only blend mode 0 (which does a full replace of the frame). It's not ideal because it means the PNG is bigger, but it should work. Try it and let me know.
On Tue., 19 Jun. 2018, 18:05 Andrew Ellerton, [email protected] wrote:
Ok. I'll be able to look in more detail in a few days.
On Tue., 19 Jun. 2018, 16:06 A-Annie, [email protected] wrote:
Hi ellerton I tried the latest version, the issue also happend...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-398312017, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EopELXE2cqiW38iEjG5A4-_JLaN6Hks5t-LD0gaJpZM4Uo5om .
Hi ellerton I used the png image is full frames, and play normal on the browser. I used some static images to make up the PNG format of dynamic images with software(apngasm_gui64.exe), the zip is original image! and what's mean about blend mode 0? pngtest.zip password:123456
Hi Annie,
I'll try to explain more clearly.
The PNG format is "chunk-based", in that it is a file composed of a number of standard "chunks". Each chunk has a 4 byte header (e.g. IHDR
) and a length.
A typical image, such as each individual frame you used, will have chunks like this:
IHDR (data)
IDAT (data)
IDAT (more data)
...
IEND
You can read more about the format here: http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
The "APNG" file format describes extra chunks to put into a PNG file. In this way the original image can still be read by any normal program (because the normal chunks are still there) but it can also be read by programs that have code to detect the extra chunks.
So, if you have 3 individual image they might have chunks like this:
- image1.png:
IHDR...IDAT...IEND
- image2.png:
IHDR...IDAT...IEND
- image3.png:
IHDR...IDAT...IEND
When you process those individual frames into a PNG, you get a single file that might have a layout like this:
IHDR
IDAT (original image, and optionally image 0)
acTL
fcTL
fdAT (image 1)
fcTL
fdAT (image 2)
fcTL
fdAT (image 3)
IEND
The data for the extra frames is in those fdAT
chunks, and the way in which that image is composed is in the fcTL
chunks.
You can read about the APNG specification here: https://wiki.mozilla.org/APNG_Specification
The fcTL
chunk describes how the frame is drawn: https://wiki.mozilla.org/APNG_Specification#.60fcTL.60:_The_Frame_Control_Chunk
One way to compose each frame over the previous is simply to write the entire new image over the previous. This is nice and simple but means the entire frame must be provided, which the APNG file will be bigger.
Another way is to write over only part of the image (an image may cover only part of the full frame) and another way is to blend over the previous frame. Search for "blend_op" on the previous link.
It looks like all the frames that aren't working use blend_mode=1, while the frames the are fine use blend_mode=0.
I thought the minor change I made would address it, but it sounds like it hasn't.
I don't know for sure because I can't test on android at the moment.
The image renders correctly in the browser because the browser doesn't have a bug with APNG rendering.
What I've proposed is that in the meantime (that is, before a bug fix can be done), that you assembling the APNG differently and see if that helps.
I searched for apngasm
and it looks like it has flags to disable optimisation:
-kp: keep the original palette, do not optimize it.
-kc: keep the original PNG color type, do not optimize it.
Try building your APNG with one or both of those options, and see if that works.
To be clear: this is a bug that needs to be addressed, but unless you can contribute a fix, it can only be looked at when I have time.
Hi ellerton Good news!! I used the another tool for make the png image, and the issue fixed, but I don't know what the mode is.
That's great, thanks for letting me know.
Perhaps post the image here so I can compare and see what makes it work?
On Mon., 25 Jun. 2018, 09:26 A-Annie, [email protected] wrote:
Hi ellerton Good news!! I used the another tool for make the png image, and the issue fixed, but I don't know what the mode is.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-399806035, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EojUelF3lIueBG3_iMs0mCg5hygVsks5uADxIgaJpZM4Uo5om .
Got it, thanks.
Out of interest, what are you building with it?
job demand (#^.^#)
Haha - I figured that :)
It's always interesting to know what projects your work is being used it.
Is it for Beijing trains?
On Mon., 25 Jun. 2018, 10:09 A-Annie, [email protected] wrote:
job demand (#^.^#)
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-399810948, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7EojfdfFUpApJvROHhO4vFKABAqzc0ks5uAEZJgaJpZM4Uo5om .
Not that I'm just doing a dynamic display, and I'm just looking for these picture, it's not related to work...
Hah cool
On Mon., 25 Jun. 2018, 10:50 A-Annie, [email protected] wrote:
Not that I'm just doing a dynamic display, and I'm just looking for these picture, it's not related to work...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/aellerton/japng_android/issues/5#issuecomment-399815960, or mute the thread https://github.com/notifications/unsubscribe-auth/AA7Eohp8MiZS7WTL42eP70eATq0H90ujks5uAE_dgaJpZM4Uo5om .