Skip to content

Instantly share code, notes, and snippets.

View homm's full-sized avatar
💭
Fighting JPEG color banding

Alexander Karpinsky homm

💭
Fighting JPEG color banding
  • Uploadcare
View GitHub Profile
@homm
homm / karabiner.json
Created November 16, 2023 12:25
Karabiner config for Ilya Birman's typography layouts on left-and-right-from-the-space modifier single press
{
"profiles": [
{
"complex_modifications": {
"rules": [
{
"description": "Change input source to Birman Layout.",
"manipulators": [
{
"from": {
@homm
homm / yieder.py
Last active November 23, 2023 09:04
import time
import collections
import functools
import itertools
TIMES = 200
N = 200
M = 10

First of all, never trust a benchmark which you can't reproduce. You can't reproduce lilliput-bench for the obvious reason: there are no test images. And since this is the benchmark which tests graphics codecs, results heavily depend on exact files modes and even content. So the first, what you need, is create some test data.

Now, with the installation instruction, we can start. This is my results on i5-4430 CPU (the same Haswell architecture as in the original test) and Ubuntu 18.04.1 LTS, running on bare metal. Pillow-SIMD version 5.2.0.post0 compiled with AVX2 running on Python 2.7.

JPEG 1920x1080 header read:  1920x1080,  avg: 0.036190 ms  min: 0.033855 ms  max: 7.170200 ms
PNG 1920x1080 header read:   1920x1080,  avg: 0.040357 ms  min: 0.038862 ms  max: 0.266075 ms
WEBP 1920x1080 header read:  1920x1080,  avg: 0.678090 ms  min: 0.149965 ms  
/*
// Copyright 2012 2016 Intel Corporation All Rights Reserved.
//
// The source code, information and material ("Material") contained herein is
// owned by Intel Corporation or its suppliers or licensors, and title
// to such Material remains with Intel Corporation or its suppliers or
// licensors. The Material contains proprietary information of Intel
// or its suppliers and licensors. The Material is protected by worldwide
// copyright laws and treaty provisions. No part of the Material may be used,
// copied, reproduced, modified, published, uploaded, posted, transmitted,
#!/usr/bin/python
import sys
import time
from PIL import Image, ImageFilter, PILLOW_VERSION
class Timer:
def __init__(self, name):
self.name = name
window.getDevicePixelRatio = function () {
var ratio = 1;
// To account for zoom, change to use deviceXDPI instead of systemXDPI
if (window.screen.systemXDPI !== undefined && window.screen.logicalXDPI !== undefined && window.screen.systemXDPI > window.screen.logicalXDPI) {
// Only allow for values > 1
ratio = window.screen.systemXDPI / window.screen.logicalXDPI;
}
else if (window.devicePixelRatio !== undefined) {
ratio = window.devicePixelRatio;
}
from __future__ import print_function
import gc
import traceback
import types
from tornado import web, ioloop, gen
from tornado.http1connection import HTTP1ServerConnection
def find_circular_references(garbage=None):
/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Benchmark.h"
#include "SkBlurMask.h"
#include "SkCanvas.h"
from scandir import scandir
def recursive_scandir(dir):
stack = []
it = scandir(dir)
while it or stack:
it = it or stack.pop()
try:
item = next(it)
#!/usr/bin/env python
from __future__ import print_function
import sys
import gc
from scandir import scandir
def recursive_scandir(dir):
stack = []