Skip to content

Instantly share code, notes, and snippets.

View norsez's full-sized avatar
💭
busy coding

Norsez Orankijanan norsez

💭
busy coding
View GitHub Profile
@norsez
norsez / MovieWriter.swift
Created May 11, 2017 04:13 — forked from isthisjoe/MovieWriter.swift
Swift 3 | macOs | Write NSImage(s) to a movie file. Modified from http://stackoverflow.com/a/36297656/1275125
import AppKit
import AVFoundation
class MovieWriter: NSObject {
func writeImagesAsMovie(_ allImages: [NSImage], videoPath: String, videoSize: CGSize, videoFPS: Int32) {
// Create AVAssetWriter to write video
guard let assetWriter = createAssetWriter(videoPath, size: videoSize) else {
print("Error converting images to video: AVAssetWriter not created")
return
}
@norsez
norsez / Iphone Icon.png Bash Script
Created July 19, 2012 10:00 — forked from jessedc/iOS Icon.png bash script
A simple bash script using OSX command line tool sips to resample a 512x512px image
#!/bin/bash
f=$(pwd)
sips --resampleWidth 512 "${f}/${1}" --out "${f}/iTunesArtwork"
sips --resampleWidth 57 "${f}/${1}" --out "${f}/Icon.png"
sips --resampleWidth 114 "${f}/${1}" --out "${f}/Icon@2x.png"
sips --resampleWidth 29 "${f}/${1}" --out "${f}/Icon-Small.png"
sips --resampleWidth 58 "${f}/${1}" --out "${f}/Icon-Small@2x.png"
sips --resampleWidth 50 "${f}/${1}" --out "${f}/Icon-Small-50.png"
sips --resampleWidth 72 "${f}/${1}" --out "${f}/Icon-72.png"