nigeekaus Posted July 23, 2009 Report Share Posted July 23, 2009 Hi Guys, I am writing a VI will when run, will enable me to rotate an image. Right now this is what I am working on: 1. Image -> Pixmap (using Picture to Pixmap VI) 2. Pixmap -> 2D array (using Unflatten Pixmap VI) 3. 2D array to -> Pixmap (using Flatten Pixmap VI) 4. Pixmap -> Picture (using Pixmap to Picture VI) The problem I am facing is that if my picture has in it "Hello", the output is hello, yet the background fill of the picture has gone from the original colour (transparent) to black. I was wondering why this occurs, especially since I'm not rotating the picture as of yet, there shouldn't be a change in the pixels. Further investigation leads me to think that there might be something in last stage of the processing (stage 4). I am attaching the VI in question. Hope some one can point me in the right direction. Regards, Rotate Simple Image_2.vi Quote Link to comment
vugie Posted July 23, 2009 Report Share Posted July 23, 2009 You loose transperency in both 1st and 4th stage. In 1st because "Picture to Pixmap" stores transparency only in 4th byte of 32-bit image data, not in the mask. You have to manually convert this data to mask and perform your operations on the mask as well. But I've noticed that the transparency data generated by "Picture to Pixmap" in not compatibile to similar data generated by "Load PNG"... Bug? I have to do more testing on this. If you know something about the image you may generate mask yourself from color image data (i.e. using "Create Mask"). I would reccomend you using my BitMan library which helps with such situations and perform all operations on transparency automaticly. 1 Quote Link to comment
vugie Posted July 23, 2009 Report Share Posted July 23, 2009 Correction: "Picture to Pixmap" generates 24-bit image data (without a mask), so no transparency is preserved here in any form. Quote Link to comment
nigeekaus Posted July 24, 2009 Author Report Share Posted July 24, 2009 (edited) Hi Vugie, Thanks for the information and the screenshots. I did download BitMan and I created a VI. I am attaching the screen shot of what happens below. Any idea why I get a white background? Edit: Helps if I actually attach the file :-) Edited July 24, 2009 by nigeekaus Quote Link to comment
Melbourne Posted July 24, 2009 Report Share Posted July 24, 2009 Many thanks for all the replies - seems it a complex fix to what at fist would seem to be a simple issue Quote Link to comment
vugie Posted July 24, 2009 Report Share Posted July 24, 2009 (edited) Hi Vugie, Thanks for the information and the screenshots. I did download BitMan and I created a VI. I am attaching the screen shot of what happens below. Any idea why I get a white background? Edit: Helps if I actually attach the file :-) Because picture control has such On the front panel you have to switch to set color tool, right-clik on picture control and select transparent color (upper-right corner, marked with T) And the angle for rotation should be in radians proba transp.vi Edited July 24, 2009 by vugie 1 Quote Link to comment
Karis Posted August 2, 2013 Report Share Posted August 2, 2013 You loose transperency in both 1st and 4th stage. In 1st because "Picture to Pixmap" stores transparency only in 4th byte of 32-bit image data, not in the mask. You have to manually convert this data to mask and perform your operations on the mask as well. But I've noticed that the transparency data generated by "Picture to Pixmap" in not compatibile to similar data generated by "Load PNG"... Bug? I have to do more testing on this. If you know something about the image you may generate mask yourself from color image data (i.e. using "Create Mask").I would reccomend you using my BitMan library which helps with such situations and perform all operations on transparency automaticly. transpbd.png transpfp.png Thanks a lot. This was very helpful for me! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.