It is currently Thu Dec 05, 2019 10:45 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] PB5.71b1 SaveImage(16Bit) = #True
PostPosted: Fri Jun 21, 2019 8:29 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Mar 02, 2009 9:20 pm
Posts: 110
Location: Germany
When using SaveImage() with 16 bit color depth (which is NOT supported by PureBasic), then the function return #False for BMPs and no file is created. This is correct, but...

When doing the same with JPEG, JPEG200 or PNG, the function returns #True and a 24bpp file is being created! (although I actually can't prove it for JPEG2000, since I've got no appropriate sofware installed to check, I guess it's also true there)

By the way, the debugger will correctly complain for any format, that 16 bit is not a supported color depth.

Code:
UseJPEGImageEncoder()
UseJPEG2000ImageEncoder()
UsePNGImageEncoder()

CreateImage(0,32,32,32)
StartDrawing(ImageOutput(0))
Define c
For y = 0 To 31
  For x = 0 To 31
    RandomData(@c,4)
    Plot(x,y,c)
  Next
Next
StopDrawing()

;################################################
;################################################
dir$="D:\TEMPORÄR\"
;################################################
;################################################

Debug SaveImage( 0, dir$+"bmp.bmp", #PB_ImagePlugin_BMP     , 10, 16) ; -> returns 0, saves no file
Debug SaveImage( 0, dir$+"jpg.jpg", #PB_ImagePlugin_JPEG    , 10, 16) ; -> returns 1, saves 24bpp file
Debug SaveImage( 0, dir$+"jp2.jp2", #PB_ImagePlugin_JPEG2000, 10, 16) ; -> returns 1, saves 24bpp file
Debug SaveImage( 0, dir$+"png.png", #PB_ImagePlugin_PNG     , 10, 16) ; -> returns 1, saves 24bpp file


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB5.71b1] SaveImage(16Bit) = #True
PostPosted: Fri Jun 21, 2019 10:24 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13638
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye