<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>mikeash.com pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html comments</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>mikeash.com Recent Comments</description><lastBuildDate>Sun, 10 May 2026 04:26:35 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>starmessage - 2014-08-12 19:49:58</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>Very good description.
&lt;br /&gt;
&lt;br /&gt;I am trying to write a cross platform (windows + OSX) image class and have difficulties in the MAC part.
&lt;br /&gt;I am using NSImage as the basic element and the bmp representation to draw pixels in it.
&lt;br /&gt;While this works ok when I load an image from a file into NSimage and then there is a ready bmp representation to modify its pixels before I draw the nsimage on an nsview.
&lt;br /&gt;
&lt;br /&gt;My problems begin when I want to create a blank nsimage and modify its pixels.
&lt;br /&gt;I am failing at all different sequences of attaching a bmp rep ont the image.
&lt;br /&gt;
&lt;br /&gt;I will examine your proposals.</description><guid isPermaLink="true">a8c817d4482936d971120ac972cb83b1</guid><pubDate>Tue, 12 Aug 2014 19:49:58 GMT</pubDate></item><item><title>mikeash - 2012-09-05 14:21:33</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>&lt;b&gt;Johan Sørensen:&lt;/b&gt; Thanks, that was silly of me. Fixed now.</description><guid isPermaLink="true">3cf029198f9814896e68f6e554727cd1</guid><pubDate>Wed, 05 Sep 2012 14:21:33 GMT</pubDate></item><item><title>Johan Sørensen - 2012-09-05 08:56:06</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>Nice introduction!
&lt;br /&gt;
&lt;br /&gt;Your NSBitmapImageRep initializer is missing the bitsPerSample argument though</description><guid isPermaLink="true">3142a0cd45216a9068e330ee80a76d6e</guid><pubDate>Wed, 05 Sep 2012 08:56:06 GMT</pubDate></item><item><title>Josh Bleecher Snyder - 2012-09-01 14:40:53</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>bytesPerRow and friends are used not just for memory alignment but also for copy-free subimages. It's a significant feature and design consideration that's worth going into.</description><guid isPermaLink="true">a3153b9666c229b9c2edd62306d48376</guid><pubDate>Sat, 01 Sep 2012 14:40:53 GMT</pubDate></item><item><title>mikeash - 2012-09-01 00:05:37</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>Or if you're rendering manually somewhere, you can just set a transform before you render.</description><guid isPermaLink="true">65630ea5d71f5e36ec763913dfee2bf3</guid><pubDate>Sat, 01 Sep 2012 00:05:37 GMT</pubDate></item><item><title>rudy - 2012-08-31 22:44:06</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>@Zev
&lt;br /&gt;
&lt;br /&gt;presumably you're using the image you've gotten from your CGBitmapContext in a UIView or on a CALayer? you can just apply an affine transform to the view/layer and it'll be rotated for you.</description><guid isPermaLink="true">d1a81f9af9eee67ee14066ef476b2de1</guid><pubDate>Fri, 31 Aug 2012 22:44:06 GMT</pubDate></item><item><title>Zev Eisenberg - 2012-08-31 21:45:40</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>Marginally related question: on iOS, if I have some pixels rendered into a &lt;code&gt;CGBitmapContext&lt;/code&gt;, if I want to render a rotated version of that image, do I have to grab an image and draw it into a new context with a transform applied? Or is there a quicker way?</description><guid isPermaLink="true">0822d9343d46238d961b8be97d9d8169</guid><pubDate>Fri, 31 Aug 2012 21:45:40 GMT</pubDate></item><item><title>mikeash - 2012-08-31 16:24:03</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>The nice thing is that once you understand the basics of this stuff, using &lt;code&gt;CGBitmapContext&lt;/code&gt; is pretty easy.</description><guid isPermaLink="true">914c91094ac9e51f33515404b98e6ce1</guid><pubDate>Fri, 31 Aug 2012 16:24:03 GMT</pubDate></item><item><title>Torsten - 2012-08-31 16:07:59</title><link>http://www.mikeash.com/?page=pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html#comments</link><description>A nice introduction! A frequent use for this technology is to load textures into OpenGL. The advantage is that any format can be used as a texture, including PSDs and even PDF files. That means no conversion step when testing out new art.
&lt;br /&gt;
&lt;br /&gt;(Personally, though, I prefer to use CGImage and CGContext for this. It takes a bit more work, but one has more control especially over where the Alpha value ends up)</description><guid isPermaLink="true">73b4a1226bc34e05dbb2ba203a69d92a</guid><pubDate>Fri, 31 Aug 2012 16:07:59 GMT</pubDate></item></channel></rss>
