Skip to content

Instantly share code, notes, and snippets.

@castaneai
Created January 11, 2018 17:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save castaneai/79e3d13adeae68cc881ee78c89fb91c8 to your computer and use it in GitHub Desktop.
Save castaneai/79e3d13adeae68cc881ee78c89fb91c8 to your computer and use it in GitHub Desktop.
clip studio paint -> png
import sqlite3
data = open('test.clip', 'rb').read()
sqlite_head = data.index(b'SQLite format 3')
with open('test.sqlite3', 'wb') as dbf:
dbf.write(data[sqlite_head:])
sqlite = sqlite3.connect('test.sqlite3')
image_data = sqlite.execute('select ImageData from CanvasPreview').fetchone()[0]
with open('test.png', 'wb') as imf:
imf.write(image_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment