View Single Post
Old 18th April 2015, 11:48   #350  |  Link
r0lZ
PgcEdit daemon
 
r0lZ's Avatar
 
Join Date: Jul 2003
Posts: 7,469
Yes, I know. It's unpredictable.

I am still working on a (possible) solution.

When a subtitle stream must be converted to 3D, it is necessary to convert it to XML/PNG format anyway. I can therefore take any PNG in the set of images that has been generated by BDSup2Sub, and analyse it to get its histogram. Then, I can extract the 3 most used colours from the histogram, verify if they form a shade of greys (or perhaps also yellows), and if it's the case, use them to build a palette dynamically, and use that palette to generate the final 3D VobSub file.

However, there are still several problems.
1. If the user wants the 2D subtitles in VobSub format, there is no need to convert it to XML/PNG, and therefore I have no PNG file to analyse. (IMO, it will be a waste of time to convert to a temp XML/PNG file anyway, just to analyse the colours.)
2. A single subtitle stream may contain subtitles in different colours. For example, some subtitles may be yellow, and others white. Therefore, picking a single PNG is not sufficient to ensure that all colours necessary to convert the whole stream will be suitable. (And analysing all PNGs is too time consuming and too complex.)
3. Even with "good" colours in the available slots of the palette, there is no guarantee that BDSup2Sub will use them correctly. It may still use them blindly, without knowing that they have changed. So, the result is not guaranteed.

However, the method should work relatively well in most cases (when all subtitles of the set use the same black, white and gray or yellow colours).

I may add an option to *try* to generate a better palette automatically for the 3D subtitles in VobSub format, but I still have to do numerous tests to be sure that that will give relatively good results, and of course to be sure that the result will never be worse than with the default palette. Currently, I'm still not convinced.
__________________
r0lZ
PgcEdit homepage (hosted by VideoHelp)
BD3D2MK3D A tool to convert 3D blu-rays to SBS, T&B or FS MKV

Last edited by r0lZ; 18th April 2015 at 11:50.
r0lZ is offline