Skip to content

Instantly share code, notes, and snippets.

View hirocarma's full-sized avatar

hiro hirocarma

  • Liberal profession
  • JAPAN
View GitHub Profile
#!/usr/bin/env python
import sys
import numpy as np
import matplotlib.pyplot as plt
import wave
import scipy.signal as signal
import math
LIMIT_DB = 20
MAX_DB = 85
#!/usr/bin/env python
import numpy as np
from scipy.io.wavfile import write
import matplotlib.pyplot as plt
sample_rate = 44100
duration = 10
def generate_blue_noise(duration, sample_rate):
#!/usr/bin/env python
from PIL import Image, ImageDraw, ImageFont
import matplotlib.colors as mcolors
import colorsys
import cv2
import numpy as np
from scipy.spatial import KDTree
height = 100
width = 600
import os
import sys
import cv2
import numpy as np
from scipy.io import wavfile
from scipy.signal import firwin, lfilter
from scipy.signal.windows import hamming
import matplotlib.pyplot as plt
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.io import wavfile
import cv2
def wav_to_image_with_rgb(wav_file, image_file):
sample_rate, data = wavfile.read(wav_file)
import os
import sys
import cv2
import numpy as np
from scipy.io import wavfile
import matplotlib.pyplot as plt
def image_to_audio(image_path, output_wav, output_spectrogram):
img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
import os
import sys
import cv2
import numpy as np
from scipy.io import wavfile
def image_to_audio(image_path, output_wav):
img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE)
height, width = img.shape
#!/usr/bin/env python
from PIL import Image, ImageDraw, ImageFont
import matplotlib.colors as mcolors
import colorsys
import cv2
import numpy as np
from scipy.spatial import KDTree
height = 100
# width = 400
#!/usr/bin/env python
from PIL import Image, ImageDraw, ImageFont
import matplotlib.colors as mcolors
import colorsys
import numpy as np
from scipy.spatial import KDTree
height = 200
width = 400
txt_x = 2
from PIL import Image, ImageDraw
height = 300
width = 600
txt_x = 2
txt_y = 2
txt_color = "red"
def color_save(text, color_rgb):