{"action":"created","issue":{"url":"https://api.github.com/repos/lvandeve/lodepng/issues/15","labels_url":"https://api.github.com/repos/lvandeve/lodepng/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/lvandeve/lodepng/issues/15/comments","events_url":"https://api.github.com/repos/lvandeve/lodepng/issues/15/events","html_url":"https://github.com/lvandeve/lodepng/issues/15","id":103941934,"number":15,"title":"Would it be possible to support ARGB?","user":{"login":"LinusU","id":189580,"avatar_url":"https://avatars.githubusercontent.com/u/189580?v=3","gravatar_id":"","url":"https://api.github.com/users/LinusU","html_url":"https://github.com/LinusU","followers_url":"https://api.github.com/users/LinusU/followers","following_url":"https://api.github.com/users/LinusU/following{/other_user}","gists_url":"https://api.github.com/users/LinusU/gists{/gist_id}","starred_url":"https://api.github.com/users/LinusU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LinusU/subscriptions","organizations_url":"https://api.github.com/users/LinusU/orgs","repos_url":"https://api.github.com/users/LinusU/repos","events_url":"https://api.github.com/users/LinusU/events{/privacy}","received_events_url":"https://api.github.com/users/LinusU/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-30T19:40:36Z","updated_at":"2015-08-31T11:08:41Z","closed_at":null,"body":"Hi, thank for a great library!\r\n\r\nI was wondering if it would be possible to add `LCT_ARGB` to support storing the raw data with the order `ARGB` instead of `RGBA`. This is the format that [cairo][cairo] uses natively.\r\n\r\nHaving this would save me from doing the conversion in memory before hand, which I would guess is much slower.\r\n\r\nThanks!\r\n\r\n[cairo]: http://cairographics.org"},"comment":{"url":"https://api.github.com/repos/lvandeve/lodepng/issues/comments/136336469","html_url":"https://github.com/lvandeve/lodepng/issues/15#issuecomment-136336469","issue_url":"https://api.github.com/repos/lvandeve/lodepng/issues/15","id":136336469,"user":{"login":"lvandeve","id":4254201,"avatar_url":"https://avatars.githubusercontent.com/u/4254201?v=3","gravatar_id":"","url":"https://api.github.com/users/lvandeve","html_url":"https://github.com/lvandeve","followers_url":"https://api.github.com/users/lvandeve/followers","following_url":"https://api.github.com/users/lvandeve/following{/other_user}","gists_url":"https://api.github.com/users/lvandeve/gists{/gist_id}","starred_url":"https://api.github.com/users/lvandeve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lvandeve/subscriptions","organizations_url":"https://api.github.com/users/lvandeve/orgs","repos_url":"https://api.github.com/users/lvandeve/repos","events_url":"https://api.github.com/users/lvandeve/events{/privacy}","received_events_url":"https://api.github.com/users/lvandeve/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T11:08:41Z","updated_at":"2015-08-31T11:08:41Z","body":"Hello,\r\n\r\nThe decision is for LodePNG to not do color conversions other than to exactly those models that exist in the PNG specification.\r\n\r\nThe reason for this is that there exist billions of possible color models, so converting to them would require a library of its own.\r\n\r\nIn your case, would it work for you to load to RGBA, and then use a for loop to swap the bytes to the order you want? This should not cost speed, since, if LodePNG did it internally it had to do the same thing anyway.\r\n\r\nJust to give an idea about the amount of possible color models:\r\n-any permutation of order of R, G, B and A, almost anything is getting used somewhere, ARGB, ABGR, RGBA, BGRA, ...\r\n-whether or not A is present\r\n-bits per pixel or per individual component (e.g. there exists 565 RGB and so on)\r\n-whether alpha is premultiplied\r\n-whether scanlines end at bytes or can end at bits in between, or even at a multiple of 4 bytes like BMP does\r\n-whether it's mirrored (like BMP also does)\r\n-and this didn't even get into YUV, HSL, and so on :)\r\n\r\nSo supporting anything outside of the PNG spec would mean having to support them all, and really that's outside of the scope of an image loading library imho :)\r\n\r\nRegards,\r\n\r\n-Lode"}}