2022-09-17
Color Transfer Between Images, Histogram Based Style Transfer

图像调色风格转换 可以创建蹦迪特效 让视频或者图片五彩斑斓

color transfer between images

1
2
pip install color_transfer

official scikit-learn histogram matching

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import matplotlib.pyplot as plt
from skimage import data
from skimage import exposure
from skimage.exposure import match_histograms
reference = data.coffee()
image = data.chelsea()
matched = match_histograms(image, reference, channel_axis=-1)
fig, (ax1, ax2, ax3) = plt.subplots(nrows=1, ncols=3, figsize=(8, 3),
sharex=True, sharey=True)
for aa in (ax1, ax2, ax3):
aa.set_axis_off()
ax1.imshow(image)
ax1.set_title('Source')
ax2.imshow(reference)
ax2.set_title('Reference')
ax3.imshow(matched)
ax3.set_title('Matched')
plt.tight_layout()
plt.show()

histogram matching

Read More

2022-07-10
Video Effects Transitions

Read More

2022-07-10
Advanced Ass Subtitle Karaoke Effects

Advanced ASS Subtitle Karaoke Effects

library collection and guide on how to create karakoe effects programmatically

lrc files

crop music that does not sing too early? maybe no need.

we need to sort them out by time! prevent serious issues.

skip empty lines?

lrc files only have start time but no end time.

we group parallel lyrics by time, if they are close enough we make it into a group.

groups act as time separators. no two group share the same time. also group have maximum span time, minimum span time calculated by content, and group should always in bound.

should apply the same min-max rule when selecting my video clips

all ass file tags, for custom karaoke effects creation

my karaoke effect:

1
2
3
{\k-50\K400}
{\k-<initial offset>\K<total duration>}

play ass file with mpv on demo video, full screen, no audio:

1
2
3
rootpath=/Users/jamesbrown/desktop/works/pyjom_remote/
mpv --fs --no-audio --sub-file="$rootpath/tests/karaoke_effects/pyonfx_test/examples/2 - Beginner/Output.ass" "$rootpath/samples/video/karaoke_effects_source.mp4"

create karaoke effects

https://github.com/Kagu-chan/FXSpindle

karaoke effects

https://github.com/Youka/NyuFX

pyonfx code

recommend to use effect 2 beginners -> 3 variants in examples, while 3 advanced -> 2 testing pixels as reference (more advanced but incomplete, and might be very intensive)

pyonfx documentation

https://github.com/logarrhythmic/karaOK

aegisub and its plugins

https://github.com/Myaamori/aegisub-cli

https://github.com/qwe7989199/Lyric-Importer-for-Aegisub

https://github.com/qwe7989199/aegisub_scripts

https://github.com/lyger/Aegisub_automation_scripts

http://www.aegisub.org/

eyecandy create karaoke ass files:

https://github.com/Alquimista/Eyecandy-py

create karaoke effects subtitle with lrc file, support chinese

https://github.com/DYY-Studio/lrc2ass_py3

Read More