Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
18th July 2023, 06:19 | #1 | Link |
Chiptuner & VapourSynther
Join Date: Mar 2019
Location: Scarlet Devil Mansion, Gensōkyō
Posts: 52
|
FFMS2 changing RGB values when importing palette-indexed BMP/PNG files
I don’t know if this is a bug in VapourSynth R63 or in FFMS2 3.0.1.0 1325+16 6ad7738, but basically when importing (via core.ffms2.Source) indexed BMP or PNG images (that is, images whose pixels don’t store RGB color values but rather indices to a color palette stored in the files’ metadata), some of their pixels’ RGB color values get changed to slightly-different values, even when they’re imported in RGB24 mode (rather than a YUV or YCbCr mode). (This problem does not happen at all with regular RGB24 BMP/PNG files where RGB values are stored directly in the pixels themselves instead of in a palette.)
Attached to this thread is a ZIP with two visually-identical 16×16-pixel BMP files where each pixel is a different shade of gray (out of the 256 values allowed in GRAY8). Y8_index.bmp is the indexed or palettized version (8-bit grayscale palette, 256 indices), while Y8_rgb.bmp is the RGB24-mode version. This is the VPY script I am running to test VapourSynth & FFMS2’s behavior when handling indexed images vs. RGB24 images: Code:
import vapoursynth as vs from vapoursynth import core Y8_index = core.ffms2.Source(r'Y8_index.bmp',fpsnum=60,fpsden=1) Y8_rgb = core.ffms2.Source(r'Y8_rgb.bmp',fpsnum=60,fpsden=1) FinalVideo = Y8_index*60+Y8_rgb*60 FinalVideo.set_output()
__________________
SilSinn9801 a.k.a. Silent Sinner in Scarlet Discord: silsinn9801 Matrix: silsinn9821:matrix.org YouTube: https://youtube.com/SilentSinnerInScarlet ニコニコ動画: https://nicovideo.jp/user/68029427 |
19th July 2023, 07:12 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 11,009
|
How to upload pictures
https://forum.doom9.org/showthread.php?p=1959414
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
19th July 2023, 14:25 | #4 | Link |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,588
|
Or just create issues on github and attach it there. I have vowed to ignore all other types of bug reports.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
1st August 2023, 07:12 | #5 | Link |
Chiptuner & VapourSynther
Join Date: Mar 2019
Location: Scarlet Devil Mansion, Gensōkyō
Posts: 52
|
Sorry for late reply (real-life issues + my daily work). Here is the attachment but in Google Drive: https://drive.google.com/file/d/1DcH...usp=drive_link
__________________
SilSinn9801 a.k.a. Silent Sinner in Scarlet Discord: silsinn9801 Matrix: silsinn9821:matrix.org YouTube: https://youtube.com/SilentSinnerInScarlet ニコニコ動画: https://nicovideo.jp/user/68029427 |
1st August 2023, 07:14 | #6 | Link |
Chiptuner & VapourSynther
Join Date: Mar 2019
Location: Scarlet Devil Mansion, Gensōkyō
Posts: 52
|
I haven’t had time either to test this using a newer version of FFMS2 & see if the issue is a VapourSynth problem or a FFMS2 problem, hence why I specified in my original post the FFMS2 version I used.
__________________
SilSinn9801 a.k.a. Silent Sinner in Scarlet Discord: silsinn9801 Matrix: silsinn9821:matrix.org YouTube: https://youtube.com/SilentSinnerInScarlet ニコニコ動画: https://nicovideo.jp/user/68029427 |
Tags |
ffms2, indexed palette, rgb24, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|