omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. FuckingNerd

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    • Profile
    • Following 0
    • Followers 2
    • Topics 3
    • Posts 13
    • Best 0
    • Controversial 0
    • Groups 0

    FuckingNerd

    @FuckingNerd

    0
    Reputation
    257
    Profile views
    13
    Posts
    2
    Followers
    0
    Following
    Joined Last Online

    FuckingNerd Unfollow Follow

    Latest posts made by FuckingNerd

    • RE: Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      Helps for the effort man!

      posted in Pythonista
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

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

      posted in Pythonista
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      So the photo module as asset is the issue.

      posted in Pythonista
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd
    • RE: Image.UI gets color inverted if photo is PNG

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

      posted in Pythonista
      FuckingNerd
      FuckingNerd
    • Image.UI gets color inverted if photo is PNG

      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
      FuckingNerd
      FuckingNerd