mjuhasz / BDSup2Sub

Blu-Ray/DVD subtitle editor
Apache License 2.0
211 stars 47 forks source link

BDSup2Sub should have an option to use hqx for subtitle scaling #43

Open mjuhasz opened 11 years ago

mjuhasz commented 11 years ago

http://forum.doom9.org/showthread.php?p=1634720#post1634720

Suggestion: BDSup2Sub should have an option to use hqx for subtitle scaling. I've done a test run scaling DVD subtitles to HD resolution using hqx and the results are fantastic, much better than any of the current scaling options in BDSup2Sub. This sort of scaling doesn't work well for photos and such, but it seems ideal for scaling DVD subtitles with their limited resolution and color palette. It may also work decently for HD subtitles, but I don't think there would be much benefit and it may cause a posterization effect because of the wider color palette. The big downside is that it is slow.

Basically, I used hqx to scale my DVD subtitle to 3x its normal resolution, then I used a more general-purpose scaling algorithm (Lanczos) to scale/stretch it back down to the exact right dimensions for HD. I then did a contrast boost to get back the sharpness/whiter whites/blacker blacks. I'm not sure how well it might work with other color combinations than black/white, but I think it would probably work quite well. I believe there is a sample implementation in both Java and C.