STR #2633

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]

Return to Bugs & Features | Post Text | Post File | SVN ⇄ GIT | Prev | Next ]

STR #2633

Application:FLTK Library
Status:5 - New
Priority:1 - Request for Enhancement, e.g. asking for a feature
Scope:3 - Applies to all machines and operating systems
Subsystem:Image Support
Summary:New methods for Fl_JPEG_Image and Fl_PNG_Image to encode from Fl_Image
Created By:mingodad
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size top right image
#1 mingodad
02:23 May 17, 2011
bottom left image   bottom right image

Trouble Report Comments:

Post Text ]
Name/Time/Date Text top right image
#1 mingodad
02:23 May 17, 2011
Here is a patch to fltk 1.3 that add a static method for Fl_JPEG_Image and Fl_PNG_Image to encode from Fl_Image to JPEG and PNG format on memory.  
#2 ianmacarthur
02:51 May 17, 2011
I moving this to 1.4 temporarily so that it will not block the release of 1.3.0.

Also, somne comments:

- The PNG encoder needs to handle image depths of 2 also (i.e. greyscale with alpha) which it currently does not.

- The JPEG encoder needs to process images with alpha too, not just discard them.

- The name of the method, "encode" may not be appropriate - the fltk-style is more to call it "store" or "save" or something I guess. We should also make it explicit that this creates an in-memory version of the compressed image (which can then be written to file if needs be, of course.)
#3 matt
03:00 May 17, 2011
I suggest that we add code to save to a file as well. I'd call them "compress_to_file(const char *filename,...)" and "compress_to_memory(void*,...)" or "save_to_file" and "save_to_memory".  
#4 ianmacarthur
03:08 May 17, 2011
Seems reasonable.
The "save to file" versions would just wrap the in-memory versions?
Or be standalone functions?
#5 mike
13:17 May 17, 2011
Might be useful to include a background color for saving to JPEG - then the colors in the image can be composited with the background color...  
#6 ianmacarthur
13:28 May 17, 2011
Yes - seems like a good idea, if we are going to catch the alpha, we need *something* to blend it with.
I guess we'd default to white (or black?) if no colour were supplied?
#7 mike
13:52 May 17, 2011
Probably default to white...  
bottom left image   bottom right image

Return to Bugs & Features | Post Text | Post File ]


Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to ''.