Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Sullivan JoshuaSullivan

View GitHub Profile
@JoshuaSullivan
JoshuaSullivan / core-image-filters-ios-13.md
Last active July 29, 2023 21:50
An enumeration of iOS 13 Core Image filters.
View core-image-filters-ios-13.md
@JoshuaSullivan
JoshuaSullivan / midjourney-quickstart.md
Last active July 29, 2023 20:55
Midjourney Quick-Start Guide
View midjourney-quickstart.md

Midjourney Quick-Start Guide

Midjourney is a commercial image generation and transformation AI service. Similar services include:

  • DALL-E 2 (Microsoft)
  • Nightcafe
  • Stable Diffusion (Open Source)

Midjourney is a somewhat opinionated AI and tends to try to create "art". It has a very high level of coherence, which means elements in the resulting images tend to have natural relationships with a low level of glitches and random weirdness. In my opinion, Midjourney has much higher quality "out of the box", trouncing the competition unless the user is quite advanced at effectively utilizing both positive and negative prompt particles.

@JoshuaSullivan
JoshuaSullivan / PerlinNoise.cikernel
Last active July 10, 2023 22:51
My attempt at writing a Perlin Noise function.
View PerlinNoise.cikernel
// Improved Noise - Copyright 2002 Ken Perlin.
// Adapted and updated for iOS by Joshua Sullivan, 2016.01.12
// Apply the function 6t^5 - 15t^4 + 10t^3
float fade(float t)
{
return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
}
// I'm keeping this around for reference.
@JoshuaSullivan
JoshuaSullivan / display-link-combine-playground.swift
Created November 10, 2019 00:14
This gist demonstrates how we can wrap CADisplayLink to get frame refresh events via a published stream rather than the traditional `target:selector:` methodology.
View display-link-combine-playground.swift
@JoshuaSullivan
JoshuaSullivan / ColorCubeHelper-swift2.swift
Last active May 16, 2023 11:57
Here are the Swift 2.3 and Swift 3.0 versions of the ColorCubeHelper class.
View ColorCubeHelper-swift2.swift
//
// ColorCubeHelper.swift
//
// Created by Joshua Sullivan on 10/01/16.
// Copyright © 2016 Joshua Sullivan. All rights reserved.
//
import UIKit
import Accelerate
@JoshuaSullivan
JoshuaSullivan / ColorCubeImageCreator-swift2.swift
Last active April 25, 2023 16:45
The Color Cube Image Creator creates the specially formatted images needed to create data for the CIColorCube filter.
View ColorCubeImageCreator-swift2.swift
//
// ColorCubeImageCreator.swift
// ColorCubeImageCreator
//
// Created by Joshua Sullivan on 4/25/16.
// Copyright © 2016 Joshua Sullivan. All rights reserved.
//
import UIKit
@JoshuaSullivan
JoshuaSullivan / Confusion.cikernel
Created January 26, 2016 19:47
A confusing issue with the CIKernel's sample() method. Assigning the result of samplerTransform() to a variable and then using it in the sample() method breaks everything.
View Confusion.cikernel
// This works.
kernel vec4 simpleFilter(sampler p)
{
vec2 dc = destCoord();
return sample(p, samplerTransform(p, dc));
}
// This does not. It produces [0, 0, 0, 255] for the first 255 pixels and then [0, 0, 0, 0] thereafter.
kernel vec4 simpleFilter(sampler p)
{
@JoshuaSullivan
JoshuaSullivan / CoreImageFilterEnumeration.swift
Created October 11, 2020 22:35
A Swift Playground that will enumerate the properties of all of the CoreImage filters.
View CoreImageFilterEnumeration.swift
import Foundation
import CoreImage
struct FilterInput {
struct ValueRange {
let minValue: Float
let maxValue: Float
let sliderMin: Float?
let sliderMax: Float?
@JoshuaSullivan
JoshuaSullivan / CapturedImageSampler.swift
Created October 1, 2017 01:38
The source code for an object that helps you sample RGB values from ARFrames.
View CapturedImageSampler.swift
//
// CapturedImageSampler.swift
// ARKitTest
//
// Created by Joshua Sullivan on 9/22/17.
// Copyright © 2017 Joshua Sullivan. All rights reserved.
//
import UIKit
import ARKit