Advertisement
here2share

# grayscaler_for_ai_art_gen.py

Mar 22nd, 2023 (edited)
775
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. # grayscaler_for_ai_art_gen.py
  2.  
  3. ttt = {}
  4. for (left,middle,right), vvv in zzz:
  5.     t = vvv + [left,middle,right]
  6.     H = 255-max(t)
  7.     L = min(t)
  8.     for i in range(0, L+1):
  9.         k = (H+left-i,H+middle-i,H+right-i)
  10.         if k not in ttt:
  11.             v = [H+v-i for v in vvv]
  12.             try:
  13.                 v += zzz[k]
  14.                 v = list(set(v))
  15.             except:
  16.                 0
  17.             ttt[k] = v
  18.             # print(k, ttt[k])
  19.  
  20. import os
  21. import tempfile
  22.  
  23. fd, path = tempfile.mkstemp()
  24. with os.fdopen(fd, 'w') as tmp:
  25.     tmp.write(str(ttt))
  26. os.open(path)
  27. print('done.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement