{"action":"created","issue":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/915","repository_url":"https://api.github.com/repos/jcupitt/libvips","labels_url":"https://api.github.com/repos/jcupitt/libvips/issues/915/labels{/name}","comments_url":"https://api.github.com/repos/jcupitt/libvips/issues/915/comments","events_url":"https://api.github.com/repos/jcupitt/libvips/issues/915/events","html_url":"https://github.com/jcupitt/libvips/pull/915","id":308824514,"number":915,"title":"WIP: Adds a region shrink method","user":{"login":"harukizaemon","id":333,"avatar_url":"https://avatars3.githubusercontent.com/u/333?v=4","gravatar_id":"","url":"https://api.github.com/users/harukizaemon","html_url":"https://github.com/harukizaemon","followers_url":"https://api.github.com/users/harukizaemon/followers","following_url":"https://api.github.com/users/harukizaemon/following{/other_user}","gists_url":"https://api.github.com/users/harukizaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/harukizaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harukizaemon/subscriptions","organizations_url":"https://api.github.com/users/harukizaemon/orgs","repos_url":"https://api.github.com/users/harukizaemon/repos","events_url":"https://api.github.com/users/harukizaemon/events{/privacy}","received_events_url":"https://api.github.com/users/harukizaemon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-27T05:14:14Z","updated_at":"2018-03-27T05:30:51Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/jcupitt/libvips/pulls/915","html_url":"https://github.com/jcupitt/libvips/pull/915","diff_url":"https://github.com/jcupitt/libvips/pull/915.diff","patch_url":"https://github.com/jcupitt/libvips/pull/915.patch"},"body":"Addresses issue https://github.com/jcupitt/libvips/issues/859 to add a mechanism for preserving the domain of input pixel values when performing `dzsave` and `tiffsave`.\r\n\r\nThe solution allows us to build image viewers with tools that can manipulate individual phases of very large (multi-GiB) segmented images via deep zoom and pyramid TIFF representations.\r\n\r\n* Adds a `VipsRegionShrink` enum with values `VIPS_REGION_SHRINK_MEAN` and `VIPS_REGION_SHRINK_MEDIAN`\r\n\r\n* Adds `VipsRegionShrink` as parameter `method` to `vips_region_shrink()`\r\n\r\n* Existing calls to `vips_region_shrink()` default to `VIPS_REGION_SHRINK_MEAN` to effect the current behaviour\r\n\r\nThe new `VIPS_REGION_SHRINK_MEDIAN` method is currently only implemented so as to perform well, and such that we can make the following guarantees about the resulting pixel values:\r\n\r\n* *ONLY* available for non-complex uncoded images pixel types\r\n* *ALWAYS* drawn from the input values\r\n* *NEVER* interpolated\r\n* *NOT* stable with respect to the ordered set of input values\r\n* *ARE* stable with respect to the initial arrangement of input values\r\n\r\nFor example, given every possible permutation of the input pixels values `1, 3, 7, 11`, we would generate the following output values:\r\n\r\n```\r\n[1, 3, 7, 11] => 3\r\n[1, 3, 11, 7] => 3\r\n[1, 7, 3, 11] => 7\r\n[1, 7, 11, 3] => 7\r\n[1, 11, 3, 7] => 7\r\n[1, 11, 7, 3] => 7\r\n[3, 1, 7, 11] => 3\r\n[3, 1, 11, 7] => 3\r\n[3, 7, 1, 11] => 7\r\n[3, 7, 11, 1] => 7\r\n[3, 11, 1, 7] => 7\r\n[3, 11, 7, 1] => 7\r\n[7, 1, 3, 11] => 7\r\n[7, 1, 11, 3] => 7\r\n[7, 3, 1, 11] => 7\r\n[7, 3, 11, 1] => 7\r\n[7, 11, 1, 3] => 3\r\n[7, 11, 3, 1] => 3\r\n[11, 1, 3, 7] => 7\r\n[11, 1, 7, 3] => 7\r\n[11, 3, 1, 7] => 7\r\n[11, 3, 7, 1] => 7\r\n[11, 7, 1, 3] => 3\r\n[11, 7, 3, 1] => 3\r\n```"},"comment":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/comments/376401940","html_url":"https://github.com/jcupitt/libvips/pull/915#issuecomment-376401940","issue_url":"https://api.github.com/repos/jcupitt/libvips/issues/915","id":376401940,"user":{"login":"harukizaemon","id":333,"avatar_url":"https://avatars3.githubusercontent.com/u/333?v=4","gravatar_id":"","url":"https://api.github.com/users/harukizaemon","html_url":"https://github.com/harukizaemon","followers_url":"https://api.github.com/users/harukizaemon/followers","following_url":"https://api.github.com/users/harukizaemon/following{/other_user}","gists_url":"https://api.github.com/users/harukizaemon/gists{/gist_id}","starred_url":"https://api.github.com/users/harukizaemon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/harukizaemon/subscriptions","organizations_url":"https://api.github.com/users/harukizaemon/orgs","repos_url":"https://api.github.com/users/harukizaemon/repos","events_url":"https://api.github.com/users/harukizaemon/events{/privacy}","received_events_url":"https://api.github.com/users/harukizaemon/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T05:30:51Z","updated_at":"2018-03-27T05:30:51Z","author_association":"NONE","body":"Ugh, I've just noticed that, due to editor settings, end-of-lines and whitespace changes have also occurred. Apparently GitHub supports adding `?w=1` to the URL to ignore them. Alternatively, I can redo if that would be more acceptable."}}
{"actor":{"display_login":"harukizaemon"}}