• FuckingNerd

    I was able to solve the problem.

    Instead of using asset.get_ui_image() and pass it on to SpriteNode(Texture(..ui_image..)) I got a PIL image directly with asset.get_image() and transformed it with the scripts found here to and ui image.

    relevant from above link:

    # pil <=> ui
    def pil2ui(imgIn):
        with io.BytesIO() as bIO:
            imgIn.save(bIO, 'PNG')
            imgOut = ui.Image.from_data(bIO.getvalue())
        del bIO
        return imgOut
    

    I hope you find this useful google hero from the future. This solves “weird false inverted colors for PNG ui.image from assets in photo module”.

    posted in Pythonista read more
  • FuckingNerd

    Helps for the effort man!

    posted in Pythonista read more
  • FuckingNerd

    Did that. No color invert. So it’s the asset.

    posted in Pythonista read more
  • FuckingNerd

    I have no idea how to access those imported files(never done it). This is not the way it seems. Can you help me out ?

    posted in Pythonista read more
  • FuckingNerd

    So the photo module as asset is the issue.

    posted in Pythonista read more
  • FuckingNerd

    Can you change the texture with .yourSpriteNode.texture = Texture( image ) ? I suspect it might be the assignment where it happens. Not during initialization.

    posted in Pythonista read more
  • FuckingNerd

    The file is fine. The display as SpriteNode is the issue. JPG gets rendered correctly PNG not. I have many other PNGs, all seem to be color inverted when displayed as a spritenode.

    posted in Pythonista read more
  • FuckingNerd

    relevant code

    def prev_image(self):
            if self.current_album_pic_id <= 0:
                return
            self.current_album_pic_id -= 1
            
            self.canvasSprite.texture = Texture( self.get_current_image() )
            self.rescale_canvas() 
    
    def get_current_image(self):
            image = self.get_current_asset().get_ui_image()
            return image
    

    posted in Pythonista read more
  • FuckingNerd

    here is the image from my album and a screenshot from my app

    posted in Pythonista read more
  • FuckingNerd

    So I am working on something that involves the photo and scene modules. I take a photo from the photoalbum and display it as SpriteNode on the screen through Texture. However, I noticed that some pictures get displayed color inverted this way. I figured out that it seemed to be when the images are PNGs, JPEGs are just fine. To solve this, I could run an color inversion filter if the asset is PNG, but I would like to know where the problem comes from in the first place. Any advice ?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!