Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 399 by
honestab...@gmail.com: Webpmux -get frame n : Does not handle "Features present: animation transparency" properly
https://bugs.chromium.org/p/webp/issues/detail?id=399What steps will reproduce the problem?
1. call webpmux -get frame 2 input.webp -o output.webp
2. inspect output.webp in chrome or other webp compatible app to see the missing pixel
What is the expected output? What do you see instead?
Expected :
Receive the full size frame, in this case 320w 180h, without missing pixel data.
Current Results :
A smaller frame, 234w 247h, along with missing pixel data (blacked out sections of the output frame)
What version of the product are you using? On what operating system?
libwebp-1.0.0-windows-x86
Windows 10
Please provide any additional information below.
How I corrected the issue :
It appears to me that alpha is being used to store a binary mask for where pixel data should be copied from the previous frame.
currentframe = decodeframe()
if currentframe.has_alpha :
x_offset,y_offset,width,height = currentframe.bounds
# setup masks for copying new and previous frame data separately
mask = currentframe.getAlpha() # get only the A channel from the currentframe, the bit mask is 1 where new frame data is
n_mask = bitwise_not(currentframe.getAlpha()) # not the bitmask so we have a 1 where old frame data is
# get the missing frame data
missingFrameData = previousFrame.cropped(x_offset, y_offset, width, height)
missingFrameData = bitwise_and(missingFrameData, n_mask)
# zero out anywhere that isn't new frame data
rgb_currentFrame = currentFrame.rgb()
rgb_currentFrame = bitwise_and(rgb_currentFrame, mask)
#merge
compositeFrame = missingFrameData + rgb_currentFrame
fullFrame = previousFrame.setArea(compositeFrame, x_offset, y_offset, width, height)
previouseFrame = fullFrame
else :
...
The first decoded frame is output properly, ie webpmux -get frame 1 input.webp -o output.webp
Webp files with animations without "Features present: animation transparency" appear to output just fine.
It is in Webp files with the feature "animation transparency" enabled that the issues appear
Only frames encoding an alpha seem to be having issues.
Calling webpmux -info input.webp can be used to test if issue will occur
input.webp
Canvas size: 320 x 180
Features present: animation transparency
Background color : 0xFFFFFFFF Loop Count : 0
Number of frames: 24
...
Thanks for your time
Attachments:
input.webp 117 KB
--
You received this message because:
1. The project was configured to send all issue notifications to this address
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings