Re: Doubled Pixels

2017-06-25 Thread Quincey Morris
On Jun 25, 2017, at 21:28 , Gerriet M. Denkmann wrote: > >> On 26 Jun 2017, at 08:03, Graham Cox > > wrote: >> >> Well, it depends on what you want to do with the image. If it’s content that >> gets displayed or

Re: Doubled Pixels

2017-06-25 Thread Gerriet M. Denkmann
> On 26 Jun 2017, at 08:03, Graham Cox wrote: > >> On 25 Jun 2017, at 7:39 pm, Gerriet M. Denkmann wrote: >> >> Which of these two lines is preferable: >> NSString *colorSpaceName = useColour ? NSDeviceRGBColorSpace : >>

Re: Doubled Pixels

2017-06-25 Thread Graham Cox
> On 25 Jun 2017, at 7:39 pm, Gerriet M. Denkmann wrote: > > Which of these two lines is preferable: > NSString *colorSpaceName = useColour ? NSDeviceRGBColorSpace : > NSDeviceWhiteColorSpace; > NSString *colorSpaceName = useColour ? NSCalibratedRGBColorSpace

Re: Doubled Pixels

2017-06-25 Thread Gerriet M. Denkmann
> On 25 Jun 2017, at 09:29, Graham Cox wrote: > > You could get the colorSpaceName from the source image and use that. If > there’s no conversion needed between the images it’ll probably be faster > (though seems you are giving yourself the option of creating a

Re: Doubled Pixels

2017-06-24 Thread Graham Cox
> On 24 Jun 2017, at 4:46 pm, Gerriet M. Denkmann wrote: > >> By making the NSBitMapRepresentation yourself, creating a context for it, >> drawing to that. >> —Graham > > You severely underestimate the depth of my ignorance. It took me half a day > to fathom your (for

Re: Doubled Pixels

2017-06-24 Thread Gerriet M. Denkmann
> On 23 Jun 2017, at 23:37, Jens Alfke wrote: > > >> On Jun 23, 2017, at 8:45 AM, Gerriet M. Denkmann wrote: >> >> the image looks fine, but when I write subData to disk, it has 64 x 64 >> pixels. > > You’re probably running this on a computer with

Re: Doubled Pixels

2017-06-23 Thread Jeff Szuhay
For a different reason, I’ve posted the most complete CGBitmapContext example I’ve seen anywhere (which is why I posted it). You can see it here http://www.blinddogsoftware.com/goodies/#DontSpillTheBits and customize to your needs. You can ignore the CGLayers, CGImage, and CIImage

Re: Doubled Pixels

2017-06-23 Thread Graham Cox
> On 24 Jun 2017, at 1:45 am, Gerriet M. Denkmann wrote: > > the image looks fine, but when I write subData to disk, it has 64 x 64 pixels. By making the NSBitMapRepresentation yourself, creating a context for it, drawing to that. If you make it yourself using the

Doubled Pixels

2017-06-23 Thread Gerriet M. Denkmann
macOS 12.5 I try to make a sub image (subRect has size 32 x 32) like: NSRect pubRect = NSZeroRect; pubRect.size = subRect.size; NSImage *subImage = [ [NSImage alloc] initWithSize: subRect.size ]; [ subImage lockFocus ]; [ self.imagedrawAtPoint:NSMakePoint(0, 0)