# Aseprite convolution matrices            -*- Shell-script -*-
# Copyright (C) 2001-2011, 2015 by David Capello
#
# Parser in "src/effect/convmatr.c"
#
# Format:
#
#   matrix-name w h cx cy { data } div bias target
#
# References:
#
#   w      = 1 ... N
#   h      = 1 ... N
#            width and height of the matrix
#
#   cx     = 0 ... w-1
#   cy     = 0 ... h-1
#            center of the matrix
#
#   data   = N0 N1 ... N(w*h)
#            elements of the matrix
#
#   div    = N != 0 | auto
#            final division factor
#            auto = sum(data)
#
#   bias   = -N ... +N | auto
#            final shift
#
#   target = rgba
#            [r]ed, [g]reen, [b]lue, [a]lpha
#

brightness 1 1 0 0 { 1 } 1 +8 rgb
contrast 1 1 0 0 { 1 } 1 -8 rgb
negative 1 1 0 0 { -1 } auto auto rgb

blur-3x3 3 3 1 1
  { 1 2 1
    2 4 2
    1 2 1 } auto auto rgba

blur-3x3-hard 3 3 1 1
  { 0 1 0
    1 8 1
    0 1 0 } auto auto rgba

blur-5x5 5 5 2 2
  { 1 2 3 2 1
    2 3 4 3 2
    3 4 5 4 3
    2 3 4 3 2
    1 2 3 2 1 } auto auto rgba

blur-7x7 7 7 3 3
  { 1 2 3 4 3 2 1
    2 3 4 5 4 3 2
    3 4 5 6 5 4 3
    4 5 6 7 6 5 4
    3 4 5 6 5 4 3
    2 3 4 5 4 3 2
    1 2 3 4 3 2 1 } auto auto rgba

blur-9x9 9 9 4 4
  { 1 2 3 4 5 4 3 2 1
    2 3 4 5 6 5 4 3 2
    3 4 5 6 7 6 5 4 3
    4 5 6 7 8 7 6 5 4
    5 6 7 8 9 8 7 6 5
    4 5 6 7 8 7 6 5 4
    3 4 5 6 7 6 5 4 3
    2 3 4 5 6 5 4 3 2
    1 2 3 4 5 4 3 2 1 } auto auto rgba

blur-17x17 17 17 8 8
  {  1  2  3  4  5  6  7  8  9  8  7  6  5  4  3  2  1
     2  3  4  5  6  7  8  9 10  9  8  7  6  5  4  3  2
     3  4  5  6  7  8  9 10 11 10  9  8  7  6  5  4  3
     4  5  6  7  8  9 10 11 12 11 10  9  8  7  6  5  4
     5  6  7  8  9 10 11 12 13 12 11 10  9  8  7  6  5
     6  7  8  9 10 11 12 13 14 13 12 11 10  9  8  7  6
     7  8  9 10 11 12 13 14 15 14 13 12 11 10  9  8  7
     8  9 10 11 12 13 14 15 16 15 14 13 12 11 10  9  8
     9 10 11 12 13 14 15 16 17 16 15 14 13 12 11 10  9
     8  9 10 11 12 13 14 15 16 15 14 13 12 11 10  9  8
     7  8  9 10 11 12 13 14 15 14 13 12 11 10  9  8  7
     6  7  8  9 10 11 12 13 14 13 12 11 10  9  8  7  6
     5  6  7  8  9 10 11 12 13 12 11 10  9  8  7  6  5
     4  5  6  7  8  9 10 11 12 11 10  9  8  7  6  5  4
     3  4  5  6  7  8  9 10 11 10  9  8  7  6  5  4  3
     2  3  4  5  6  7  8  9 10  9  8  7  6  5  4  3  2
     1  2  3  4  5  6  7  8  9  8  7  6  5  4  3  2  1 } auto auto rgba

blur-5x3-left 5 3 0 1
  { 2 3 2 1 0
    6 4 3 2 1
    2 3 2 1 0 } auto auto rgba

blur-17x3-left 17 3 0 1
  { 14 16 13 12 10  8  6  4 3 2 1 0 0 0 0 0 0
    24 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
    14 16 13 12 10  8  6  4 3 2 1 0 0 0 0 0 0 } auto auto rgba

blur-3x17-top 3 17 1 0
  { 14 24 14
    16 16 16
    13 15 13
    12 14 12
    10 13 10
     8 12  8
     6 11  6
     4 10  4
     3  9  3
     2  8  2
     1  7  1
     0  6  0
     0  5  0
     0  4  0
     0  3  0
     0  2  0
     0  1  0 } auto auto rgba

blur-5x5-diagonal(\) 5 5 2 2
  { 1 1 1 0 0
    1 2 2 1 0
    1 2 3 2 1
    0 1 2 2 1
    0 0 1 1 1 } auto auto rgba

blur-5x5-diagonal(/) 5 5 2 2
  { 0 0 1 1 1
    0 1 2 2 1
    1 2 3 2 1
    1 2 2 1 0
    1 1 1 0 0 } auto auto rgba

sharpen-3x3 3 3 1 1
  { -1 -1 -1
    -1 16 -1
    -1 -1 -1 } 8 0 rgba

sharpen-5x5 5 5 2 2
  {  0 -1 -2 -1  0
    -1 -2 -4 -2 -1
    -2 -4 48 -4 -2
    -1 -2 -4 -2 -1
     0 -1 -2 -1  0 } 8 0 rgba

sharpen-7x7 7 7 3 3
  {  0 -1  -2  -4  -2 -1  0
    -1 -2  -4  -8  -4 -2 -1
    -2 -4  -8 -16  -8 -4 -2
    -4 -8 -16 224 -16 -8 -4
    -2 -4  -8 -16  -8 -4 -2
    -1 -2  -4  -8  -4 -2 -1
     0 -1  -2  -4  -2 -1 -0 } 16 0 rgba

edges-find 3 3 1 1
  { -1 -1 -1
    -1  8 -1
    -1 -1 -1 } 1 0 rgba

edges-find-horizontal 3 3 1 1
  { -1 -2 -1
     0  0  0
     1  2  1 } 1 0 rgba

edges-find-vertical 3 3 1 1
  { -1  0  1
    -2  0  2
    -1  0  1 } 1 0 rgba

misc-contour 3 3 1 1
  { 1  1  1
    1 -8  1
    1  1  1 } 1 255 rgb

misc-texturize 3 3 1 1
  { -2 -2  1
    -2  1  2
    -1  2  2 } 1 0 rgba

misc-emboss 3 3 1 1
  { -4 -2 -1
    -2  1  2
     1  2  4 } 1 0 rgba

misc-marmolize 3 3 1 1
  { -1 -1  1
    -1  0  1
    -1  1  1 } 2 128 rgb

misc-rock 3 3 1 1
  { -4 -2 -1
    -2  0  2
     1  2  4 } auto auto rgb

misc-rock-edges 3 3 1 1
  { -1 -1 -1
    -1  8 -1
    -1 -1 -1 } auto auto rgb

drunk-3x3_x 3 3 1 1
  { 1 0 1
    0 1 0
    1 0 1 } auto auto rgba

drunk-3x3_+ 3 3 1 1
  { 0 1 0
    1 1 1
    0 1 0 } auto auto rgba

drunk-5x5_x 5 5 2 2
  { 1 0 0 0 1
    0 0 0 0 0
    0 0 1 0 0
    0 0 0 0 0
    1 0 0 0 1 } auto auto rgba

drunk-5x5_+ 5 5 2 2
  { 0 0 1 0 0
    0 0 0 0 0
    1 0 1 0 1
    0 0 0 0 0
    0 0 1 0 0 } auto auto rgba

drunk-7x7_x 7 7 3 3
  { 1 0 0 0 0 0 1
    0 0 0 0 0 0 0
    0 0 0 0 0 0 0
    0 0 0 1 0 0 0
    0 0 0 0 0 0 0
    0 0 0 0 0 0 0
    1 0 0 0 0 0 1 } auto auto rgba

drunk-7x7_+ 7 7 3 3
  { 0 0 0 1 0 0 0
    0 0 0 0 0 0 0
    0 0 0 0 0 0 0
    1 0 0 1 0 0 1
    0 0 0 0 0 0 0
    0 0 0 0 0 0 0
    0 0 0 1 0 0 0 } auto auto rgba

drunk-9x9_x 9 9 4 4
  { 1 0 0 0 0 0 0 0 1
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 1 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    1 0 0 0 0 0 0 0 1 } auto auto rgba

drunk-9x9_+ 9 9 4 4
  { 0 0 0 0 1 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    1 0 0 0 1 0 0 0 1
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 1 0 0 0 0 } auto auto rgba

drunk-17x17_x 17 17 8 8
  {  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1 } auto auto rgba

drunk-17x17_+ 17 17 8 8
  {  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     1  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  1
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
     0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0 } auto auto rgba

drunk-17x17_o 17 17 8 8
  {  0  0  0  0  0  0  0  1  1  1  0  0  0  0  0  0  0
     0  0  0  0  0  1  1  0  0  0  1  1  0  0  0  0  0
     0  0  0  0  1  0  0  0  0  0  0  0  1  0  0  0  0
     0  0  0  1  0  0  0  0  0  0  0  0  0  1  0  0  0
     0  0  1  0  0  0  0  0  0  0  0  0  0  0  1  0  0
     0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
     0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
     1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
     1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
     1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
     0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
     0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0
     0  0  1  0  0  0  0  0  0  0  0  0  0  0  1  0  0
     0  0  0  1  0  0  0  0  0  0  0  0  0  1  0  0  0
     0  0  0  0  1  0  0  0  0  0  0  0  1  0  0  0  0
     0  0  0  0  0  1  1  0  0  0  1  1  0  0  0  0  0
     0  0  0  0  0  0  0  1  1  1  0  0  0  0  0  0  0 } auto auto rgba

outline-transparent-layer-(cross) 3 3 1 1
  { 0 255 0
    255 255 255
    0 255 0 } 1 0 a

outline-transparent-layer-(square) 3 3 1 1
  { 255 255 255
    255 255 255
    255 255 255 } 1 0 a