[CentralOH] Python library for image processing?

Eric Miller miller.eric.t at gmail.com
Wed Apr 10 16:58:18 EDT 2019


Thanks E.  Your suggestion got me on the right track, was able to create a
numpy array from an image.  I have some questions about where to go from
there...mostly about handrolling my own cart coordinate code to brute force
pixel by pixel, vs. 'some lib/method that already solves this, that I think
exists but don't know'

Rather than spam this list, I created an SO question.  Happy and
appreciative if anyone can take a look...

https://stackoverflow.com/questions/55621100/find-closest-clusters-of-colors-in-a-numpy-array-from-an-image-file

On Tue, Apr 9, 2019 at 5:22 PM Eric Floehr <eric at intellovations.com> wrote:

> Eric,
>
> Awesome, that sounds like a really fun project! Would love to watch your
> progress on that! I bought KSP all the way back in 2013 but haven't played
> recently. It looks like they have added a bunch of cool stuff!
>
> Cheers,
> Eric
>
>
> On Tue, Apr 9, 2019 at 5:05 PM Eric Miller <miller.eric.t at gmail.com>
> wrote:
>
>> thanks Eric   I do indeed plan on doing an operation on every pixel in
>> the image.  Sounds like I may need to use a few libs to achieve it
>> efficiently.
>>
>> The goal is to parse Kerbal Space Program biome map images
>> <https://wiki.kerbalspaceprogram.com/wiki/Biome>, to determine the
>> landing spots that are nearest to the most number of surface biomes.
>>
>> On Tue, Apr 9, 2019 at 4:17 PM Eric Floehr <eric at intellovations.com>
>> wrote:
>>
>>> Eric,
>>>
>>> Depending on what you want to do, getPixel may or may not be too slow
>>> for you. Both scipy[1] and skimage (sci-kit image)[2] manipulate images as
>>> numpy arrays which allow you to do very efficient matrix operations, if
>>> say, you are doing an operation on every pixel in an image.
>>>
>>> You can also easily load an image as a numpy array directly:
>>>
>>> from PIL import Image
>>> import numpy as np
>>> image = Image.open('xyz.png')
>>> img_array = np.array(image)
>>>
>>> [1] http://cs231n.github.io/python-numpy-tutorial/#scipy-image
>>>
>>> [2] https://scikit-image.org/
>>>
>>>
>>> On Tue, Apr 9, 2019 at 4:04 PM Eric Miller <miller.eric.t at gmail.com>
>>> wrote:
>>>
>>>> Thanks, that look perfect.
>>>>
>>>> On Tue, Apr 9, 2019, 3:57 PM Joe Shaw <joe at joeshaw.org> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Check out Pillow, https://pillow.readthedocs.io/en/stable/.  It is a
>>>>> fork of the earlier PIL library.  It also integrates nicely with numpy if
>>>>> you need it.
>>>>>
>>>>> If you needed something more powerful, like bindings to the
>>>>> ImageMagick C library, then something like Wand might be better.
>>>>> https://github.com/emcconville/wand
>>>>>
>>>>> Joe
>>>>>
>>>>> On Tue, Apr 9, 2019 at 3:48 PM Eric Miller <miller.eric.t at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Looking for a library to parse each pixel in an image file. Need to
>>>>>> map each x,y pixel to its associated RGB values.
>>>>>>
>>>>>> Any recommendations for a lib that will do this well?
>>>>>>
>>>>>> Thanks!
>>>>>> _______________________________________________
>>>>>> CentralOH mailing list
>>>>>> CentralOH at python.org
>>>>>> https://mail.python.org/mailman/listinfo/centraloh
>>>>>>
>>>>> _______________________________________________
>>>>> CentralOH mailing list
>>>>> CentralOH at python.org
>>>>> https://mail.python.org/mailman/listinfo/centraloh
>>>>>
>>>> _______________________________________________
>>>> CentralOH mailing list
>>>> CentralOH at python.org
>>>> https://mail.python.org/mailman/listinfo/centraloh
>>>>
>>> _______________________________________________
>>> CentralOH mailing list
>>> CentralOH at python.org
>>> https://mail.python.org/mailman/listinfo/centraloh
>>>
>> _______________________________________________
>> CentralOH mailing list
>> CentralOH at python.org
>> https://mail.python.org/mailman/listinfo/centraloh
>>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> https://mail.python.org/mailman/listinfo/centraloh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/centraloh/attachments/20190410/4a51ee35/attachment.html>


More information about the CentralOH mailing list