I'm still getting the red's turning to pinks...

You make an interesting point about the format of the source image... i was
assuming that the image/{png,jpeg,gif} packages can read in a file and
whatever the colour profiles were, i could get the equivalent RGBA values
for them (this does appear to be the case given the available methods), and
the values are given to me in uint32's (most of the images i have seem to
have more than 8-bit colour in them).

The issue seems to be that (even if it's internal to the package) that
information is getting lost when i can get the values in uint32's (for any
image read from file; rather than created inline) for the original colour
depth, but when setting them, i have to cast them to a more basic uint8's
and then write the images back to the filesystem.

Perhaps i need to dig into https://golang.org/src/image/png
<http://s.bl-1.com/h/1TDVSRg?url=https://golang.org/src/image/png>/{reader,writer}.go
to understand what is going on and how the core image/png package decodes
and encodes stuff...


On Mon, Jul 4, 2016 at 10:13 AM, Matt Harden <matt.har...@gmail.com> wrote:

> This one avoids the type assertion: https://play.golang.org/p/vDB9RboNZj
>
> On Sun, Jul 3, 2016 at 5:11 PM Matt Harden <matt.har...@gmail.com> wrote:
>
>> If the source image is an image.RGBA, then the colors are already int8s;
>> there's no additional information to lose. Here's an example that swaps the
>> green and red channels of the pixel at (0,0):
>> https://play.golang.org/p/i6F29OsdgD
>>
>> On Sun, Jul 3, 2016 at 5:08 PM simran <simrangamb...@gmail.com> wrote:
>>
>>> Hi Dan,
>>>
>>> I am hoping to find a general matrix library as i want to write my own
>>> rotation, translation, reflection methods; however, if you do know a good
>>> image library doing these, i'd appreciate it as a reference anyway.
>>>
>>> cheers,
>>>
>>> simran.
>>>
>>> On Mon, Jul 4, 2016 at 10:00 AM, Dan Kortschak <
>>> dan.kortsc...@adelaide.edu.au> wrote:
>>>
>>>> Are you looking for generalised matrices or simply image
>>>> rotation/translation?
>>>>
>>>> On Mon, 2016-07-04 at 02:06 +1000, simran wrote:
>>>> >
>>>> > Could someone please point me to a good matrix library for Go (i'm
>>>> > sure
>>>> > something exists, although i can't seem to find it!).
>>>> >
>>>> > Am hoping to do some image manipulation for which being able to work
>>>> > with
>>>> > matrices would be great.
>>>>
>>>>
>>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to