{"action":"created","issue":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/66","labels_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/66/comments","events_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/66/events","html_url":"https://github.com/ImageMagick/ImageMagick/issues/66","id":121736172,"number":66,"title":"Preserving image properties on write","user":{"login":"Danack","id":1505719,"avatar_url":"https://avatars.githubusercontent.com/u/1505719?v=3","gravatar_id":"","url":"https://api.github.com/users/Danack","html_url":"https://github.com/Danack","followers_url":"https://api.github.com/users/Danack/followers","following_url":"https://api.github.com/users/Danack/following{/other_user}","gists_url":"https://api.github.com/users/Danack/gists{/gist_id}","starred_url":"https://api.github.com/users/Danack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danack/subscriptions","organizations_url":"https://api.github.com/users/Danack/orgs","repos_url":"https://api.github.com/users/Danack/repos","events_url":"https://api.github.com/users/Danack/events{/privacy}","received_events_url":"https://api.github.com/users/Danack/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-11T15:58:24Z","updated_at":"2015-12-30T16:35:47Z","closed_at":"2015-12-30T16:35:47Z","body":"Hi, \r\n\r\nIs it currently possible, and if not please consider this a feature request, to be able to preserve image properties when ImageMagick writes an image, when using the MagickWand api?\r\n\r\nIn particular, ImageMagick normally reduces the color depth to the smallest one that can represent the image without loss. I believe currently, if you want ImageMagick to write the image with the same color-depth as the image, you need to jump through different hoops based on what the output image format is going to be;\r\n\r\nAn example for tiff, to force 16bit tiff output.\r\n```\r\n$imagick = new Imagick();\r\n$imagick->newPseudoImage(200, 200, 'xc:white');\r\n$imagick->setType(\\Imagick::IMGTYPE_TRUECOLOR);\r\n$imagick->setImageFormat('tiff');\r\n$imagick->setImageDepth(16);\r\n$imagick->writeImage(\"./output.tif\"); \r\n```\r\n\r\nAn example of PNG, to force the image written to be the same depth as the image read.\r\n```\r\n$imagick = new Imagick(\"./testImage.png\");\r\n$imagick->flopImage();\r\n$imagick->setOption('png:format', 'png00');\r\n$imagick->writeImage(\"./output.png\");\r\n```\r\n\r\nIt would be good if it was possible (if it isn't already possible and I'm just unaware of it) to be able to set  a single option, such as:\r\n\r\n```\r\nMagickSetOption(wand, \"im:depth_preserve\", \"true\");\r\n```\r\nto be able to set the behaviour for all image types. And for the file writing to give an error if the image can't be written in the exact format as it exists in memory.\r\n"},"comment":{"url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/comments/168029712","html_url":"https://github.com/ImageMagick/ImageMagick/issues/66#issuecomment-168029712","issue_url":"https://api.github.com/repos/ImageMagick/ImageMagick/issues/66","id":168029712,"user":{"login":"Danack","id":1505719,"avatar_url":"https://avatars.githubusercontent.com/u/1505719?v=3","gravatar_id":"","url":"https://api.github.com/users/Danack","html_url":"https://github.com/Danack","followers_url":"https://api.github.com/users/Danack/followers","following_url":"https://api.github.com/users/Danack/following{/other_user}","gists_url":"https://api.github.com/users/Danack/gists{/gist_id}","starred_url":"https://api.github.com/users/Danack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Danack/subscriptions","organizations_url":"https://api.github.com/users/Danack/orgs","repos_url":"https://api.github.com/users/Danack/repos","events_url":"https://api.github.com/users/Danack/events{/privacy}","received_events_url":"https://api.github.com/users/Danack/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T16:35:47Z","updated_at":"2015-12-30T16:35:47Z","body":"If it is meant to preserve depth, and the issue was isolated to Tiffs, I will close this issue."}}