PHP colormatriximage
Posted: 2017-01-02T13:43:59-07:00
I am trying to write the server element which will render a image constructed in Flash. I'm using ColorMatrixFilter in AS3 but it takes a 4x5 matrix, whereas the PHP version takes 5x5. I don't understand what the 5th row is? I think the last column is brightness. I don't understand how ColorMatrixFilter works on AS3 either but this is what I have
[flash=] _SafeStr_10115 = new Map();
_SafeStr_19559("dark_sepia", _SafeStr_19546, [0.4, 0.4, 0.1, 0, 110, 0.3, 0.4, 0.1, 0, 30, 0.3, 0.2, 0.1, 0, 0, 0, 0, 0, 1, 0], null);
_SafeStr_19559("increase_saturation", _SafeStr_19546, [2, -0.5, -0.5, 0, 0, -0.5, 2, -0.5, 0, 0, -0.5, -0.5, 2, 0, 0, 0, 0, 0, 1, 0], null);
_SafeStr_19559("increase_contrast", _SafeStr_19546, [1.5, 0, 0, 0, -50, 0, 1.5, 0, 0, -50, 0, 0, 1.5, 0, -50, 0, 0, 0, 1.5, 0], null);
_SafeStr_19559("shadow_multiply_02", _SafeStr_19547, null, BlendMode.MULTIPLY);
_SafeStr_19559("color_1", _SafeStr_19546, [0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0], null, 1);
_SafeStr_19559("hue_bright_sat", _SafeStr_19546, [1, 0.6, 0.2, 0, -50, 0.2, 1, 0.6, 0, -50, 0.6, 0.2, 1, 0, -50, 0, 0, 0, 1, 0], null, 1);
_SafeStr_19559("hearts_hardlight_02", _SafeStr_19547, null, BlendMode.HARDLIGHT, 1);
_SafeStr_19559("texture_overlay", _SafeStr_19547, null, BlendMode.OVERLAY, 1);
_SafeStr_19559("pinky_nrm", _SafeStr_19547, null, BlendMode.NORMAL, 1);
_SafeStr_19559("color_2", _SafeStr_19546, [0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0, 0, 0, 1, 0], null, 2);
_SafeStr_19559("night_vision", _SafeStr_19546, [0, 0, 0, 0, 0, 0, 1.1, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], null, 2);
_SafeStr_19559("stars_hardlight_02", _SafeStr_19547, null, BlendMode.HARDLIGHT, 2);
_SafeStr_19559("coffee_mpl", _SafeStr_19547, null, BlendMode.MULTIPLY, 2);
[/flash]
The third argument is the colour matrix.
[flash=] _SafeStr_10115 = new Map();
_SafeStr_19559("dark_sepia", _SafeStr_19546, [0.4, 0.4, 0.1, 0, 110, 0.3, 0.4, 0.1, 0, 30, 0.3, 0.2, 0.1, 0, 0, 0, 0, 0, 1, 0], null);
_SafeStr_19559("increase_saturation", _SafeStr_19546, [2, -0.5, -0.5, 0, 0, -0.5, 2, -0.5, 0, 0, -0.5, -0.5, 2, 0, 0, 0, 0, 0, 1, 0], null);
_SafeStr_19559("increase_contrast", _SafeStr_19546, [1.5, 0, 0, 0, -50, 0, 1.5, 0, 0, -50, 0, 0, 1.5, 0, -50, 0, 0, 0, 1.5, 0], null);
_SafeStr_19559("shadow_multiply_02", _SafeStr_19547, null, BlendMode.MULTIPLY);
_SafeStr_19559("color_1", _SafeStr_19546, [0.393, 0.769, 0.189, 0, 0, 0.349, 0.686, 0.168, 0, 0, 0.272, 0.534, 0.131, 0, 0, 0, 0, 0, 1, 0], null, 1);
_SafeStr_19559("hue_bright_sat", _SafeStr_19546, [1, 0.6, 0.2, 0, -50, 0.2, 1, 0.6, 0, -50, 0.6, 0.2, 1, 0, -50, 0, 0, 0, 1, 0], null, 1);
_SafeStr_19559("hearts_hardlight_02", _SafeStr_19547, null, BlendMode.HARDLIGHT, 1);
_SafeStr_19559("texture_overlay", _SafeStr_19547, null, BlendMode.OVERLAY, 1);
_SafeStr_19559("pinky_nrm", _SafeStr_19547, null, BlendMode.NORMAL, 1);
_SafeStr_19559("color_2", _SafeStr_19546, [0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0.333, 0.333, 0.333, 0, 0, 0, 0, 0, 1, 0], null, 2);
_SafeStr_19559("night_vision", _SafeStr_19546, [0, 0, 0, 0, 0, 0, 1.1, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], null, 2);
_SafeStr_19559("stars_hardlight_02", _SafeStr_19547, null, BlendMode.HARDLIGHT, 2);
_SafeStr_19559("coffee_mpl", _SafeStr_19547, null, BlendMode.MULTIPLY, 2);
[/flash]
The third argument is the colour matrix.