{"action":"created","issue":{"url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/786","repository_url":"https://api.github.com/repos/SixLabors/ImageSharp","labels_url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/786/labels{/name}","comments_url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/786/comments","events_url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/786/events","html_url":"https://github.com/SixLabors/ImageSharp/issues/786","id":389096260,"node_id":"MDU6SXNzdWUzODkwOTYyNjA=","number":786,"title":"Gaussian Blur is not actually Gaussian","user":{"login":"Poyo-SSB","id":1782081,"node_id":"MDQ6VXNlcjE3ODIwODE=","avatar_url":"https://avatars2.githubusercontent.com/u/1782081?v=4","gravatar_id":"","url":"https://api.github.com/users/Poyo-SSB","html_url":"https://github.com/Poyo-SSB","followers_url":"https://api.github.com/users/Poyo-SSB/followers","following_url":"https://api.github.com/users/Poyo-SSB/following{/other_user}","gists_url":"https://api.github.com/users/Poyo-SSB/gists{/gist_id}","starred_url":"https://api.github.com/users/Poyo-SSB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Poyo-SSB/subscriptions","organizations_url":"https://api.github.com/users/Poyo-SSB/orgs","repos_url":"https://api.github.com/users/Poyo-SSB/repos","events_url":"https://api.github.com/users/Poyo-SSB/events{/privacy}","received_events_url":"https://api.github.com/users/Poyo-SSB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-12-10T01:31:52Z","updated_at":"2018-12-12T00:57:06Z","closed_at":null,"author_association":"NONE","body":"```csharp\r\nusing (var image = new Image<Rgba32>(128, 128))\r\n{\r\n\timage.Mutate(ctx => ctx\r\n\t\t.Fill(Rgba32.Black)\r\n\t\t.Fill(Rgba32.White, new EllipsePolygon(64, 64, 64, 64)));\r\n\r\n\timage.Mutate(ctx => ctx.GaussianBlur(12));\r\n\r\n\tusing (var stream = new FileStream(\"image.png\", FileMode.Create))\r\n\t{\r\n\t\timage.SaveAsPng(stream);\r\n\t}\r\n}\r\n```\r\n\r\nMutating an image with a Gaussian blur yields a blur that isn't quite Gaussian, much more closely resembling a box blur. I implemented a mathematically accurate Gaussian blur that factors in every pixel in the image (obviously overkill and inefficient in a 0-255 color space, but completely correct), and the results are as follows:\r\n\r\n![image](https://user-images.githubusercontent.com/1782081/49705997-adf73580-fbd7-11e8-8b87-e9f67182b4ba.png)\r\n\r\nNote the similarity between ImageSharp's Gaussian blur and its box blur.\r\n\r\nI would fix this myself and submit a PR but I genuinely have no clue why this happens. All of the processing regarding the generation of the kernel and the underlying Gaussian function seems to be correct and yields the same values as my own implementation.\r\n\r\nNotes: Using ImageSharp v1.0.0-beta0005 on .NET Framework 4.7.1 on a Windows 10 64-bit OS.\r\n"},"comment":{"url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/comments/446420823","html_url":"https://github.com/SixLabors/ImageSharp/issues/786#issuecomment-446420823","issue_url":"https://api.github.com/repos/SixLabors/ImageSharp/issues/786","id":446420823,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjQyMDgyMw==","user":{"login":"JimBobSquarePants","id":385879,"node_id":"MDQ6VXNlcjM4NTg3OQ==","avatar_url":"https://avatars2.githubusercontent.com/u/385879?v=4","gravatar_id":"","url":"https://api.github.com/users/JimBobSquarePants","html_url":"https://github.com/JimBobSquarePants","followers_url":"https://api.github.com/users/JimBobSquarePants/followers","following_url":"https://api.github.com/users/JimBobSquarePants/following{/other_user}","gists_url":"https://api.github.com/users/JimBobSquarePants/gists{/gist_id}","starred_url":"https://api.github.com/users/JimBobSquarePants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JimBobSquarePants/subscriptions","organizations_url":"https://api.github.com/users/JimBobSquarePants/orgs","repos_url":"https://api.github.com/users/JimBobSquarePants/repos","events_url":"https://api.github.com/users/JimBobSquarePants/events{/privacy}","received_events_url":"https://api.github.com/users/JimBobSquarePants/received_events","type":"User","site_admin":false},"created_at":"2018-12-12T00:57:06Z","updated_at":"2018-12-12T00:57:06Z","author_association":"MEMBER","body":"Thanks for that, appreciate it.. \r\n\r\nReading through your code it looks to me that the difference is simply the sampling radius. You sample the entire image while we sample (2 * sigma) + 1"}}
{"actor":{"display_login":"JimBobSquarePants"}}