Bestdori 谱面渲染工具
Project description
Bestdori-Render
⭐ Bestdori chart rendering tool written in Python ⭐
Features
Supports negative BPM, almost any number of lanes, SP green bar rendering, rhythm color vision assistance, and many other features.
Configuration
| Parameter Name | Type | Default Value | Description |
|---|---|---|---|
| EXPECT_HEIGHT | int | 1500 | Expected image height |
| BG_COLOR | tuple | (16, 16, 16) | Background color |
| SLICE_HEIGHT | int | 3360 + 24 | Length of the split track, it is best to be a multiple of PPS ± NOTE_SIZE[2], otherwise the note is likely to be cut |
| X_SEP | int | 80 | Width of the empty space next to the track |
| FRAME_WIDTH | int | 16 | Track border width |
| SEP_LINE_WIDTH | int | 4 | Track separation line width |
| LANE_WIDTH | int | 50 | Track spacing |
| LANE_RANGE | tuple | (None, None) | Track range, when (None, None) the track range will be automatically calculated |
| LANE_NUM | int | None | Number of tracks, when None the number of tracks will be automatically calculated |
| FONT | ImageFont.ImageFont | ImageFont.truetype("fonts/TT-Shin Go M.ttf", size=24) | Font for drawing BPM, duration, and note count |
| FRAME_COLOR | tuple | (0, 77, 77, 255) | Track border color |
| SEP_LINE_COLOR | tuple | (19, 119, 151, 50) | Track separation line color |
| DOUBLE_BEAT_LINE_COLOR | tuple | (220, 220, 220) | Double beat line color |
| BPM_LINE_LIGHT_COLOR | tuple | (255, 51, 119, 224) | Highlighted measure line color (first measure line after BPM change) |
| BPM_LINE_COLOR | tuple | (240, 240, 240, 100) | Measure line color |
| BPM_TEXT_COLOR | tuple | (255, 51, 119) | Color for drawing BPM |
| TIME_TEXT_COLOR | tuple | (255, 255, 255) | Color for drawing duration |
| NOTE_NUM_COLOR | tuple | (255, 255, 255) | Color for drawing note count |
| COLOR_LIGHT_VALUE | int | 60 | Color brightness increase value |
| X_OFFSET | int | 4 | Note offset |
| PPS | int | 480 | Pixel per Second |
| SKIN | str | "skin00_rip" | Skin |
| BLUE_WHITE_TAP | bool | True | Blue-white key (rhythm color vision assistance) |
| FLICK_OFFSET | int | 9 | Flick note vertical offset |
| DIRECTIONAL_OFFSET | int | 4 | Directional note horizontal offset |
| DIRECTIONAL_ARROW_OFFSET | int | -6 | Directional note arrow horizontal offset |
| NOTE_SIZE | tuple | (60, 24) | Note size |
| DOUBLE_BEAT_LINE_WIDTH | int | 2 | Double beat line width |
| BPM_LINE_WIDTH | int | 2 | Measure line thickness |
Usage
import requests
from bestdori.render import render
url = "https://bestdori.com/api/post/details?id=101566"
response = requests.get(url)
data = response.json()
chart_img = render(data["post"]["chart"])
# `chart_img` is a `PIL.Image.Image`
chart_img.show()
chart_img.save("101566.png")
Skins
The project only includes one set of skin00_rip skins. If you want to use other skins, you can download them from Bestdori, use Tools for Cutting Unity Sprites to cut them, rename them, place them in the resources folder, and change the value of SKIN to the folder name.
Acknowledgements
Bestdori: The largest third-party website for BanG Dream
Tools for Cutting Unity Sprites: Although I didn't use this project to cut, it looks quite useful
Thanks to LingMiao, WindowsSov8, and kumoSleeping for their ideas and inspiration on the negative BPM issue.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bestdori_render-0.1.3.tar.gz.
File metadata
- Download URL: bestdori_render-0.1.3.tar.gz
- Upload date:
- Size: 2.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.5 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f761c15ef5f7b7e6ebd3bc295c714523b911aee1a09de87b127e9c0a756b0f1
|
|
| MD5 |
809428d2f2e594e055fa37336a165fb8
|
|
| BLAKE2b-256 |
78f8157424cda90932c368856de15ecffc257726979531882b724b356741c208
|
File details
Details for the file bestdori_render-0.1.3-py3-none-any.whl.
File metadata
- Download URL: bestdori_render-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: pdm/2.25.5 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df5e8f8f1452a196204efc2b9b70357e7fee58393e5885daac095cbc2581a94a
|
|
| MD5 |
c62bb2b169765a5ae815b4180ac52a68
|
|
| BLAKE2b-256 |
239f197acebac20db9e87b298e7397deef165403c2238bb6cc217192ae906d02
|