convert -resize 800x800 -quality 100 in.png out.png
convert +append *.png out.png
| import os | |
| import shutil | |
| # Settings | |
| n, m = 6, 6 | |
| input_folder = "input" | |
| tmp_folder = "tmp" | |
| output_image = "combined_image.png" | |
| size = 300 |
| import numpy as np | |
| from PIL import Image | |
| output_image = 'fractal.png' | |
| def evalMandelbrot(x, y, n=20): | |
| c = x + 1j*y | |
| out, count = 0, 0 | |
| for i in range(n): | |
| if abs(out) <= 2: |
This is a collection of useful ffmpeg commands. Detailed description of the commands can be found in the documentation
Extract frames from video, one frame per second, where -r sets the desired framerate (e.g. -r 10 extracts 10 frames per second).
ffmpeg -i movie.mp4 -r 1 frames\\frame_%%04d.png
Create Instagram compatible video from frames
| import sys | |
| from watchdog.observers import Observer | |
| from watchdog.events import FileSystemEventHandler | |
| class EventHandler(FileSystemEventHandler): | |
| def on_any_event(self, event): | |
| print("EVENT") | |
| print(event.event_type) | |
| print(event.src_path) | |
| print() |
| import nbformat | |
| filepath = 'notebbook.ipynb' | |
| with open(filepath, 'r', encoding='utf-8') as f: | |
| nb = nbformat.read(f, as_version=4) | |
| wc_markdown, wc_heading, wc_code = 0, 0, 0 | |
| for cell in nb.cells: | |
| if cell.cell_type == "markdown": | |
| wc_markdown += len(cell['source'].replace('#', '').lstrip().split(' ')) |
| import requests | |
| import datetime | |
| import pandas as pd | |
| import json | |
| import time | |
| # Read rescuetime key | |
| with open('key.txt', 'r') as f: | |
| key = f.read() |
| import os | |
| import random | |
| from PIL import Image, ImageOps | |
| def concat_images(image_paths, size, shape=None): | |
| # Open images and resize them | |
| width, height = size | |
| images = map(Image.open, image_paths) | |
| images = [ImageOps.fit(image, size, Image.ANTIALIAS) |