Animated Gif and Animated Png from Image Folders: Can APNG be Optimized? lazarus / 39-Graphics ---------------------------------------------------------------------- Boleeman · 2024-09-02 12:02 Upgraded to: Animated Gif and Animated Png from Image Folders (see later replies) Was investigating how to make animated gifs from folders containing images (Png, Bmp, Gif, Jpg) for the Tween program. Found a thread by my friend DreamVB (from the good old PlanetVb of years gone by) on this Lazarus Forum and I expanded on his Lazarus code. Place numbered images in particular folders starting from .001 Uses TBgrabmp Can change size, delay, Loopcount Creates an output folder and lists percentage size in filename. Might be nice to add a feature to split an animated gif back to say png files. Anyhow, enjoy what I have been playing around with. Attached is also an animated gif made from a folder containing pngs which has been incresed in size to 140 percent. Greets to DreamVB. ---------------------------------------------------------------------- circular · 2024-09-02 17:13 Nice project  One remark, the OptimizeFrames method is supposed to be called after adding the frames. You will get smaller output files this way. ---------------------------------------------------------------------- Fred vS · 2024-09-02 17:21 Very nice project! Note that if you want to export to a open-source format (GIF is not open source  :'( ), you may use animated PNG (APNG): https://en.wikipedia.org/wiki/APNG And, of course, BGRABitmap can deal perfectly with it. ---------------------------------------------------------------------- Boleeman · 2024-09-03 07:48 Thanks Circular for that OptimizeFrames method advice. I was referencing different threads on animated gifs and was unsure of where to put actually put it. While investigating, I noticed some animated gif sizes seemed a bit larger than I was expecting so I see now why the OptimizeFrames method is called after adding the frames. Fred vS, thanks for your nice reply. I also wanted to look at APNG but was unaware that BGRABitmap can deal with it. The quality of the APNG animation looks amazing. I teach Basic animation at a college and wanted to maybe make a basic animator using Lazarus, and do some Squash and Stretch like your ball bounce example. I used to use Pencil animator, but have switched to Wick (Vector) Animator. This is based on Javascript. It would be nice to see something similar done in Lazarus. ---------------------------------------------------------------------- Fred vS · 2024-09-03 12:52 Hello. Yes APNG is great and can deal with transparency (Animated GIF cannot). ---------------------------------------------------------------------- Boleeman · 2024-09-03 13:28 I wonder, is there any sample code that creates APNG in Lazarus ? I know ImagingLib does it, but does TBgrabmp do it? I am interested in trying it out. ---------------------------------------------------------------------- Fred vS · 2024-09-03 13:39 Quote from: Boleeman on September 03, 2024, 03:28:52 pmI wonder, is there any sample code that creates APNG in Lazarus ? I know ImagingLib does it, but does TBgrabmp do it? I am interested in trying it out. The demo testgif was updated to render apng. https://github.com/bgrabitmap/bgrabitmap/tree/master/test/testgif Note that I did not yet try to create a apng, only render it. ---------------------------------------------------------------------- Roland57 · 2024-09-04 11:27 I didn't know APNG. Very interesting. I see it's possible to create APNG files with ImageMagick. ---------------------------------------------------------------------- Fred vS · 2024-09-04 12:50 Quote from: Roland57 on September 04, 2024, 01:27:41 pmI didn't know APNG. Very interesting. I see it's possible to create APNG files with ImageMagick. Here some investigation-solution for rendering APNG with BGRABitmap: https://github.com/bgrabitmap/bgrabitmap/issues/105 Maybe BGRABitmap could be used to create APNG too. ---------------------------------------------------------------------- circular · 2024-09-04 14:41 Yes, you can create APNG files, using TBGRAAnimatedPng class, also in BGRAAnimatedGif unit. ---------------------------------------------------------------------- Fred vS · 2024-09-04 15:09 Quote from: circular on September 04, 2024, 04:41:51 pmYes, you can create APNG files, using TBGRAAnimatedPng class, also in BGRAAnimatedGif unit.  Wow, BGRABitmap simply the best and the best simple. ---------------------------------------------------------------------- circular · 2024-09-05 12:31 Thanks. Yes, simplicity is my motto. ---------------------------------------------------------------------- Boleeman · 2024-09-06 05:19 Now saving to APNG as well as animated Gif  Might be nice to add a display animated png/gif to this demo. ---------------------------------------------------------------------- Awkward · 2024-09-06 05:46 little offtoped. why you didn't check MNG for animation? ---------------------------------------------------------------------- Boleeman · 2024-09-06 08:49 Now showing the Animated Gif/Png using FredVs gbrabmp Testgif code. Attached is a test animated png of my H-Fractal. The animated png is smaller in size than the animated gif. What I also noticed: Decreasing the size of the animated gif or animated png from 100% increases the size of the animated file. Not sure why this happens ? I naturally assumed that initially setting a smaller percentage animated image size makes the output animated image size smaller. Also test making an APNG with tweens, from my tween program. ---------------------------------------------------------------------- Boleeman · 2024-09-06 22:54 I tried out APngOptimzer at https://sourceforge.net/projects/apng/files/APNG_Optimizer/ and found it reduces the file sizes quite well. 108kb Apng becomes 18 kb 156 kb becomes 24 kb Circular, I wonder if TBgrabmp for Lazarus can do something similar ? ---------------------------------------------------------------------- lainz · 2024-09-07 00:27 Quote from: Boleeman on September 07, 2024, 12:54:56 amI tried out APngOptimzer at https://sourceforge.net/projects/apng/files/APNG_Optimizer/ and found it reduces the file sizes quite well. 108kb Apng becomes 18 kb 156 kb becomes 24 kb Circular, I wonder if TBgrabmp for Lazarus can do something similar ? We discussed this in the past with png optimizer. Is hard to port from another language the optimizer. If theres a dll maybe but if this is an exe is more hard to include. ---------------------------------------------------------------------- Fred vS · 2024-09-07 00:53 Quote from: lainz on September 07, 2024, 02:27:28 amQuote from: Boleeman on September 07, 2024, 12:54:56 amI tried out APngOptimzer at https://sourceforge.net/projects/apng/files/APNG_Optimizer/ and found it reduces the file sizes quite well. 108kb Apng becomes 18 kb 156 kb becomes 24 kb Circular, I wonder if TBgrabmp for Lazarus can do something similar ? We discussed this in the past with png optimizer. Is hard to port from another language the optimizer. If theres a dll maybe but if this is an exe is more hard to include. Also this great optimizer has zlib license, so no problem to use it even in commercial application. fpc, gcc and others use also a external strip app to reduce size. That said, I have seen that it proposes zlib, 7zip or zopfli compression and uses code from libpng like in BGRABitmap. [EDIT] Note that the Linux binary provided in the release is 32 bit.            For the Linux 64 bit, need to compile the source.            In attachment the Linux binary 64 bit.            Nice utility, it works too for png without anim, thanks to show it. ---------------------------------------------------------------------- lainz · 2024-09-07 02:14 Yes. A thing is to include a binary in lazpaint that AFAIK was already done for camera raw files. But another thing is to include an exe in bgrabitmap,that's not possible. ---------------------------------------------------------------------- Boleeman · 2024-09-07 04:30 I downloaded the cpp source of PngOptimizer from https://sourceforge.net/projects/apng/files/APNG_Optimizer/1.4/, re targeted it and compiled it to a dll instead of an exe in Visual Studio. Seemed to compile OK to a dll in Visual Studio. Made a Lazarus test program but it did not work. Not sure if DZandaa or Circular or Lainz or FredVs would know how to do it? I think DZandaa  dabbles in CSharp as well as Lazarus. Here are all the functions and addresses in the compiled dll, but how do I use that info: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  Function Name  Address         Relative Addresspng_access_version_number       0x10002610      0x00002610png_benign_error        0x10006e50      0x00006e50png_build_grayscale_palette     0x10002520      0x00002520png_calloc      0x10008b00      0x00008b00png_chunk_benign_error  0x10007080      0x00007080png_chunk_error 0x10006ff0      0x00006ff0png_chunk_warning     0x10007030      0x00007030png_convert_from_struct_tm      0x10020250      0x00020250png_convert_from_time_t 0x10020290      0x00020290png_convert_to_rfc1123  0x10002470      0x00002470png_convert_to_rfc1123_buffer   0x10002170      0x00002170png_create_info_struct  0x100018f0      0x000018f0png_create_read_struct  0x1000a790      0x0000a790png_create_read_struct_2        0x1000a7b0      0x0000a7b0png_create_write_struct 0x100202e0      0x000202e0png_create_write_struct_2       0x10020300      0x00020300png_data_freer  0x100019f0      0x000019f0png_destroy_info_struct 0x10001940      0x00001940png_destroy_read_struct 0x1000bb30      0x0000bb30png_destroy_write_struct        0x10020aa0      0x00020aa0png_error       0x10006c30      0x00006c30png_free        0x100015b0      0x000015b0png_free_data   0x10001a40      0x00001a40png_free_default        0x10008c60      0x00008c60png_get_bit_depth       0x100076b0      0x000076b0png_get_bKGD    0x10007f30      0x00007f30png_get_channels      0x10007ef0      0x00007ef0png_get_cHRM    0x10007f60      0x00007f60png_get_cHRM_fixed      0x10008210      0x00008210png_get_cHRM_XYZ        0x10008060      0x00008060png_get_cHRM_XYZ_fixed  0x10008170      0x00008170png_get_chunk_cache_max 0x10008a80      0x00008a80png_get_chunk_malloc_max        0x10008aa0      0x00008aa0png_get_color_type      0x100076d0      0x000076d0png_get_compression_buffer_size 0x10008a10      0x00008a10png_get_compression_type        0x10007730      0x00007730png_get_copyright       0x100024f0      0x000024f0png_get_current_pass_number     0x1001f820      0x0001f820png_get_current_row_number      0x1001f800      0x0001f800png_get_error_ptr       0x10007460      0x00007460png_get_filter_type     0x100076f0      0x000076f0png_get_gAMA    0x100082d0      0x000082d0png_get_gAMA_fixed      0x100082a0      0x000082a0png_get_header_ver      0x10002500      0x00002500png_get_header_version  0x10002510      0x00002510png_get_hIST    0x10008400      0x00008400png_get_iCCP    0x10008350      0x00008350png_get_IHDR    0x10008430      0x00008430png_get_image_height    0x10007690      0x00007690png_get_image_width     0x10007670      0x00007670png_get_int_32  0x10016400      0x00016400png_get_interlace_type  0x10007710      0x00007710png_get_io_chunk_type   0x10008ad0      0x00008ad0png_get_io_ptr  0x10002100      0x00002100png_get_io_state      0x10008ac0      0x00008ac0png_get_libpng_ver      0x10002500    0x00002500png_get_mem_ptr 0x10008cb0      0x00008cb0png_get_oFFs    0x100084e0      0x000084e0png_get_palette_max     0x10008ae0      0x00008ae0png_get_pCAL    0x10008540      0x00008540png_get_pHYs    0x100087b0      0x000087b0png_get_pHYs_dpi        0x10007e00      0x00007e00png_get_pixel_aspect_ratio      0x100077f0      0x000077f0png_get_pixel_aspect_ratio_fixed        0x10007860      0x00007860png_get_pixels_per_inch 0x100079f0      0x000079f0png_get_pixels_per_meter        0x100077b0      0x000077b0png_get_PLTE    0x10008810      0x00008810png_get_progressive_ptr 0x10002100      0x00002100png_get_rgb_to_gray_status      0x100089d0      0x000089d0png_get_rowbytes        0x10007630      0x00007630png_get_rows    0x10007650      0x00007650png_get_sBIT    0x10008850      0x00008850png_get_sCAL    0x10008700      0x00008700png_get_sCAL_fixed      0x100085f0      0x000085f0png_get_sCAL_s  0x10008760      0x00008760png_get_signature     0x10007f10      0x00007f10png_get_sPLT    0x100083d0      0x000083d0png_get_sRGB    0x10008310      0x00008310png_get_text    0x10008880      0x00008880png_get_tIME    0x100088d0      0x000088d0png_get_tRNS    0x10008910      0x00008910png_get_uint_16 0x10016430      0x00016430png_get_uint_31 0x100163c0      0x000163c0png_get_uint_32 0x10016400      0x00016400png_get_unknown_chunks  0x100089a0      0x000089a0png_get_user_chunk_ptr  0x100089f0      0x000089f0png_get_user_height_max 0x10008a60      0x00008a60png_get_user_transform_ptr      0x1001f7e0      0x0001f7e0png_get_user_width_max  0x10008a40      0x00008a40png_get_valid   0x10007610      0x00007610png_get_x_offset_inches 0x10007d60      0x00007d60png_get_x_offset_inches_fixed   0x10007ce0      0x00007ce0png_get_x_offset_microns        0x10007930      0x00007930png_get_x_offset_pixels 0x10007990      0x00007990png_get_x_pixels_per_inch       0x10007ab0      0x00007ab0png_get_x_pixels_per_meter      0x10007750      0x00007750png_get_y_offset_inches 0x10007db0      0x00007db0png_get_y_offset_inches_fixed   0x10007d20      0x00007d20png_get_y_offset_microns        0x10007960      0x00007960png_get_y_offset_pixels 0x100079c0      0x000079c0png_get_y_pixels_per_inch       0x10007b60      0x00007b60png_get_y_pixels_per_meter      0x10007780      0x00007780png_handle_as_unknown   0x100025b0      0x000025b0png_image_begin_read_from_file  0x1000c470      0x0000c470png_image_begin_read_from_memory        0x1000c600      0x0000c600png_image_begin_read_from_stdio 0x1000c3b0      0x0000c3b0png_image_finish_read   0x1000ff80      0x0000ff80png_image_free  0x10006be0      0x00006be0png_image_write_to_file 0x10022fe0      0x00022fe0png_image_write_to_stdio        0x10022ea0      0x00022ea0png_info_init_3 0x100019a0      0x000019a0png_init_io     0x10002120      0x00002120png_longjmp     0x10007410      0x00007410png_malloc      0x10008b60      0x00008b60png_malloc_default      0x10008bb0      0x00008bb0png_malloc_warn 0x10008be0      0x00008be0png_permit_mng_features 0x1001eb90      0x0001eb90png_process_data        0x10008cd0      0x00008cd0png_process_data_pause  0x10008e20      0x00008e20png_process_data_skip   0x10008e60      0x00008e60png_progressive_combine_row     0x1000a6d0      0x0000a6d0png_read_end    0x1000b470      0x0000b470png_read_image  0x1000b360      0x0000b360png_read_info   0x1000a870      0x0000a870png_read_png    0x1000bc90      0x0000bc90png_read_row    0x1000adb0      0x0000adb0png_read_rows   0x1000b2d0      0x0000b2d0png_read_update_info    0x1000acc0      0x0000acc0png_reset_zstream       0x100025f0      0x000025f0png_save_int_32 0x10002140      0x00002140png_save_uint_16      0x10023870      0x00023870png_save_uint_32        0x10023840    0x00023840png_set_add_alpha       0x1001f250      0x0001f250png_set_alpha_mode      0x10010860      0x00010860png_set_alpha_mode_fixed        0x10010640      0x00010640png_set_background      0x10010430      0x00010430png_set_background_fixed        0x10010330      0x00010330png_set_benign_errors   0x1001f050      0x0001f050png_set_bgr     0x1001f0a0      0x0001f0a0png_set_bKGD    0x1001bd60      0x0001bd60png_set_check_for_invalid_index 0x1001f080    0x0001f080png_set_cHRM    0x1001c040      0x0001c040png_set_cHRM_fixed      0x1001bda0      0x0001bda0png_set_cHRM_XYZ        0x1001c3b0      0x0001c3b0png_set_cHRM_XYZ_fixed  0x1001be90      0x0001be90png_set_chunk_cache_max 0x1001f010      0x0001f010png_set_chunk_malloc_max        0x1001f030      0x0001f030png_set_compression_buffer_size 0x1001eee0      0x0001eee0png_set_compression_level       0x10021540      0x00021540png_set_compression_mem_level   0x10021560      0x00021560png_set_compression_method      0x10021680      0x00021680png_set_compression_strategy    0x10021580      0x00021580png_set_compression_window_bits 0x100215a0      0x000215a0png_set_crc_action      0x10010230      0x00010230png_set_error_fn        0x10007440      0x00007440png_set_expand  0x10011520      0x00011520png_set_expand_16     0x10011620      0x00011620png_set_expand_gray_1_2_4_to_8  0x100115a0      0x000115a0png_set_filler  0x1001f170      0x0001f170png_set_filter  0x10020b90      0x00020b90png_set_filter_heuristics       0x10021210      0x00021210png_set_filter_heuristics_fixed 0x10021320      0x00021320png_set_flush   0x10020820      0x00020820png_set_gAMA    0x1001c7e0      0x0001c7e0png_set_gAMA_fixed      0x1001c750      0x0001c750png_set_gamma   0x10011410      0x00011410png_set_gamma_fixed     0x10011300      0x00011300png_set_gray_to_rgb     0x100116a0      0x000116a0png_set_hIST    0x1001c8e0      0x0001c8e0png_set_iCCP    0x1001d800      0x0001d800png_set_IHDR    0x1001ca30      0x0001ca30png_set_interlace_handling      0x1001f140      0x0001f140png_set_invalid 0x1001efd0      0x0001efd0png_set_invert_alpha    0x1001f2a0      0x0001f2a0png_set_invert_mono     0x1001f2c0      0x0001f2c0png_set_keep_unknown_chunks     0x1001ebb0      0x0001ebb0png_set_longjmp_fn      0x100071e0      0x000071e0png_set_mem_fn  0x10008c80      0x00008c80png_set_oFFs    0x1001cb00      0x0001cb00png_set_option  0x10006ac0      0x00006ac0png_set_packing 0x1001f0d0      0x0001f0d0png_set_packswap      0x1001f0f0      0x0001f0f0png_set_palette_to_rgb  0x10011520    0x00011520png_set_pCAL    0x1001cb40      0x0001cb40png_set_pHYs    0x1001d500      0x0001d500png_set_PLTE    0x1001d540      0x0001d540png_set_progressive_read_fn     0x1000a6f0      0x0000a6f0png_set_quantize        0x10010900      0x00010900png_set_read_fn 0x100101a0      0x000101a0png_set_read_status_fn  0x1000bc70      0x0000bc70png_set_read_user_chunk_fn      0x1001ee70      0x0001ee70png_set_read_user_transform_fn  0x10011a20      0x00011a20png_set_rgb_to_gray     0x10011940      0x00011940png_set_rgb_to_gray_fixed       0x100117a0      0x000117a0png_set_rows    0x1001ee90      0x0001ee90png_set_sBIT    0x1001d6a0      0x0001d6a0png_set_sCAL    0x1001d2e0      0x0001d2e0png_set_sCAL_fixed      0x1001d400      0x0001d400png_set_sCAL_s  0x1001cfe0      0x0001cfe0png_set_scale_16      0x100104c0      0x000104c0png_set_shift   0x1001f110      0x0001f110png_set_sig_bytes       0x100013f0      0x000013f0png_set_sPLT    0x1001e350      0x0001e350png_set_sRGB    0x1001d6d0      0x0001d6d0png_set_sRGB_gAMA_and_cHRM      0x1001d760    0x0001d760png_set_strip_16        0x10010540      0x00010540png_set_strip_alpha     0x100105c0      0x000105c0png_set_swap    0x1001f0b0      0x0001f0b0png_set_swap_alpha      0x1001f280      0x0001f280png_set_text    0x1001db70      0x0001db70png_set_text_compression_level  0x100216f0      0x000216f0png_set_text_compression_mem_level      0x10021710      0x00021710png_set_text_compression_method 0x10021830      0x00021830png_set_text_compression_strategy       0x10021730      0x00021730png_set_text_compression_window_bits    0x10021750      0x00021750png_set_tIME    0x1001e110      0x0001e110png_set_tRNS    0x1001e1d0      0x0001e1d0png_set_tRNS_to_alpha   0x10011520      0x00011520png_set_unknown_chunk_location  0x1001ead0      0x0001ead0png_set_unknown_chunks  0x1001e7b0      0x0001e7b0png_set_user_limits     0x1001eff0      0x0001eff0png_set_user_transform_info     0x1001f750      0x0001f750png_set_write_fn        0x1001f8a0      0x0001f8a0png_set_write_status_fn 0x100218a0      0x000218a0png_set_write_user_transform_fn 0x100218c0      0x000218c0png_sig_cmp     0x10001430      0x00001430png_start_read_image    0x1000ad40      0x0000ad40png_warning     0x10006dc0      0x00006dc0png_write_chunk 0x10023bf0      0x00023bf0png_write_chunk_data    0x10023a30      0x00023a30png_write_chunk_end     0x10023ab0      0x00023ab0png_write_chunk_start   0x100239f0      0x000239f0png_write_end   0x100200b0      0x000200b0png_write_flush 0x10020840      0x00020840png_write_image 0x10020450      0x00020450png_write_info  0x1001fcf0      0x0001fcf0png_write_info_before_PLTE      0x1001fa60      0x0001fa60png_write_png   0x100218e0      0x000218e0png_write_row   0x100204c0      0x000204c0png_write_rows  0x10020420      0x00020420png_write_sig   0x10023890      0x00023890 ---------------------------------------------------------------------- lainz · 2024-09-07 11:29 AFAIK C# dll can't be used with FPC. ---------------------------------------------------------------------- Thaddy · 2024-09-07 12:04 Quote from: lainz on September 07, 2024, 01:29:04 pmAFAIK C# dll can't be used with FPC. Yes, you can, sort of: There are at least two different mechanisms that allow it: 1. you can use the unmanagedexports tool from c# to mark code in the dll as unmanaged, so it is available in FreePascal (this can lead to some problems when functions may return nil, though) 2. you can use the regasm tool to make the dll visible as a com object. Both these tools come with the .net framework and not with FreePascal or Lazarus. I have used both methods, but with very mixed results. method 2. is the most fool proof. Neither method is suitable for beginners. I believe this was already mentioned on this forum quite a few times. Important to note is that the .net framework needs to be installed, which is a multitude of the size of the C# dll you want to use. I never tested this for mono. Also note that in my experiments I had full control over both the C# sourcecode and  the Lazarus - and Delphi - sourcecode. I never tried this with third party dll's without sourcecode. The Delphi typelibrary editor is somewhat considerably more robust than the Lazarus tool, because it favors var parameters over pointer type parameters if it knows it is a var that can/should not be nil. And the delphi generated tlb code happily compiles with FreePascal. This is only relevant if you need to import a type library for the C# com object. ---------------------------------------------------------------------- Fred vS · 2024-09-07 13:17 Quote from: Boleeman on September 07, 2024, 06:30:23 amHere are all the functions and addresses in the compiled dll, but how do I use that info: ... Hello. Afaik those methods come from the library libpng that is compiled and included into the binary executable: Here methods of libpng.so: Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  $ readelf --dyn-syms -W /usr/lib/x86_64-linux-gnu/libpng16.so.16 | grep png    46: 000000000000a470   230 FUNC    GLOBAL DEFAULT   15 png_get_pixel_aspect_ratio_fixed@@PNG16_0    47: 00000000000079e0    93 FUNC    GLOBAL DEFAULT   15 png_benign_error@@PNG16_0    48: 000000000000abf0   289 FUNC    GLOBAL DEFAULT   15 png_get_cHRM@@PNG16_0    49: 000000000000f2e0  1498 FUNC    GLOBAL DEFAULT   15 png_read_end@@PNG16_0    50: 0000000000005b50   140 FUNC  GLOBAL DEFAULT   15 png_sig_cmp@@PNG16_0    51: 000000000001ed70  1163 FUNC    GLOBAL DEFAULT   15 png_set_cHRM@@PNG16_0    52: 000000000000c380    45 FUNC    GLOBAL DEFAULT   15 png_free@@PNG16_0  53: 000000000000fed0    72 FUNC    GLOBAL DEFAULT   15 png_set_strip_16@@PNG16_0    54: 000000000000df80  1220 FUNC    GLOBAL DEFAULT   15 png_read_row@@PNG16_0    55: 0000000000027310    65 FUNC  GLOBAL DEFAULT   15 png_write_rows@@PNG16_0    56: 0000000000024fc0  81 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_method@@PNG16_0    57: 0000000000027360   107 FUNC    GLOBAL DEFAULT   15 png_write_image@@PNG16_0    58: 000000000000bbf0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_x_offset@@PNG16_0    59: 000000000000a590    39 FUNC    GLOBAL DEFAULT   15 png_get_y_offset_microns@@PNG16_0    60: 000000000000b2c0   114 FUNC    GLOBAL DEFAULT   15 png_get_oFFs@@PNG16_0    61: 000000000001f610    16 FUNC    GLOBAL DEFAULT   15 png_set_chunk_cache_max@@PNG16_0    62: 000000000000ad20 323 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_XYZ@@PNG16_0    63: 000000000001fec0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_strategy@@PNG16_0    64: 000000000000df30    70 FUNC    GLOBAL DEFAULT   15 png_start_read_image@@PNG16_0    65: 000000000001f3f0    41 FUNC    GLOBAL DEFAULT   15 png_set_oFFs@@PNG16_0    66: 0000000000005de0    12 FUNC    GLOBAL DEFAULT   15 png_get_header_version@@PNG16_0    67: 000000000002af50 364 FUNC    GLOBAL DEFAULT   15 png_image_write_to_file@@PNG16_0    68: 000000000001ff30    12 FUNC    GLOBAL DEFAULT   15 png_save_uint_16@@PNG16_0    69: 0000000000006e60    86 FUNC    GLOBAL DEFAULT   15 png_set_option@@PNG16_0    70: 0000000000028c00   175 FUNC    GLOBAL DEFAULT   15 png_set_eXIf_1@@PNG16_0    71: 0000000000028cb0   607 FUNC    GLOBAL DEFAULT   15 png_set_sCAL_s@@PNG16_0    72: 000000000000bcc0    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_blend_op@@PNG16_0    73: 00000000000256d0    81 FUNC    GLOBAL DEFAULT   15 png_write_flush@@PNG16_0    74: 000000000000d350    68 FUNC    GLOBAL DEFAULT   15 png_process_data_pause@@PNG16_0    75: 000000000001fe60  16 FUNC    GLOBAL DEFAULT   15 png_set_compression_level@@PNG16_0    76: 00000000000154d0    72 FUNC    GLOBAL DEFAULT   15 png_set_expand@@PNG16_0    77: 000000000000af30   154 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_fixed@@PNG16_0    78: 0000000000005dc0    12 FUNC    GLOBAL DEFAULT   15 png_get_header_ver@@PNG16_0    79: 000000000001f620    17 FUNC    GLOBAL DEFAULT   15 png_set_chunk_malloc_max@@PNG16_0    80: 0000000000005d90    17 FUNC  GLOBAL DEFAULT   15 png_init_io@@PNG16_0    81: 000000000000b9d0    19 FUNC    GLOBAL DEFAULT   15 png_get_chunk_malloc_max@@PNG16_0    82: 0000000000014690    22 FUNC    GLOBAL DEFAULT   15 png_set_read_user_transform_fn@@PNG16_0    83: 000000000001f5d0    20 FUNC    GLOBAL DEFAULT   15 png_set_invalid@@PNG16_0    84: 000000000001fe20    23 FUNC    GLOBAL DEFAULT   15 png_set_flush@@PNG16_0    85: 000000000000f8c0   465 FUNC    GLOBAL DEFAULT   15 png_destroy_read_struct@@PNG16_0    86: 0000000000006f90  1086 FUNC    GLOBAL DEFAULT   15 png_convert_to_rfc1123_buffer@@PNG16_0    87: 000000000000a2f0    27 FUNC    GLOBAL DEFAULT   15 png_get_filter_type@@PNG16_0    88: 000000000000da50   445 FUNC    GLOBAL DEFAULT   15 png_read_frame_head@@PNG16_0    89: 000000000001fe80    23 FUNC    GLOBAL DEFAULT   15 png_set_compression_strategy@@PNG16_0    90: 000000000000b170    56 FUNC    GLOBAL DEFAULT   15 png_get_eXIf_1@@PNG16_0    91: 000000000000b690    75 FUNC    GLOBAL DEFAULT   15 png_get_sCAL_s@@PNG16_0    92: 000000000000aba0    27 FUNC    GLOBAL DEFAULT   15 png_get_signature@@PNG16_0    93: 000000000000fb70    77 FUNC    GLOBAL DEFAULT   15 png_create_read_struct_2@@PNG16_0    94: 000000000000faa0    17 FUNC  GLOBAL DEFAULT   15 png_set_read_status_fn@@PNG16_0    95: 000000000002b1c0  1956 FUNC    GLOBAL DEFAULT   15 png_write_info_before_PLTE@@PNG16_0    96: 00000000000155c0    72 FUNC    GLOBAL DEFAULT   15 png_set_tRNS_to_alpha@@PNG16_0    97: 00000000000074b0   153 FUNC    GLOBAL DEFAULT   15 png_chunk_warning@@PNG16_0    98: 0000000000018af0    50 FUNC    GLOBAL DEFAULT   15 png_get_uint_31@@PNG16_0    99: 00000000000146b0  35 FUNC    GLOBAL DEFAULT   15 png_get_uint_32@@PNG16_0   100: 000000000002c7e0   677 FUNC    GLOBAL DEFAULT   15 png_write_end@@PNG16_0   101: 000000000000aa60    38 FUNC    GLOBAL DEFAULT   15 png_get_x_offset_inches@@PNG16_0   102: 000000000000ae70 179 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_XYZ_fixed@@PNG16_0   103: 000000000000ab80    27 FUNC    GLOBAL DEFAULT   15 png_get_channels@@PNG16_0   104: 0000000000020510    93 FUNC    GLOBAL DEFAULT   15 png_write_chunk_data@@PNG16_0   105: 000000000001fef0    27 FUNC    GLOBAL DEFAULT   15 png_set_write_user_transform_fn@@PNG16_0   106: 00000000000258b0  6752 FUNC    GLOBAL DEFAULT   15 png_write_row@@PNG16_0   107: 0000000000010750   215 FUNC    GLOBAL DEFAULT   15 png_image_begin_read_from_memory@@PNG16_0   108: 000000000001fe40     5 FUNC    GLOBAL DEFAULT   15 png_set_filter_heuristics@@PNG16_0   109: 000000000000baa0    27 FUNC    GLOBAL DEFAULT   15 png_get_num_plays@@PNG16_0   110: 000000000000ba00    11 FUNC    GLOBAL DEFAULT   15 png_get_io_chunk_type@@PNG16_0   111: 000000000000ced0    31 FUNC    GLOBAL DEFAULT   15 png_set_mem_fn@@PNG16_0   112: 000000000001fd70    21 FUNC    GLOBAL DEFAULT   15 png_get_current_row_number@@PNG16_0   113: 000000000000bc60    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_delay_den@@PNG16_0   114: 000000000000b040    44 FUNC    GLOBAL DEFAULT   15 png_get_sRGB@@PNG16_0   115: 000000000000b990    18 FUNC    GLOBAL DEFAULT   15 png_get_user_height_max@@PNG16_0   116: 0000000000024480   213 FUNC    GLOBAL DEFAULT   15 png_set_compression_buffer_size@@PNG16_0   117: 000000000001f200    81 FUNC    GLOBAL DEFAULT   15 png_set_gAMA_fixed@@PNG16_0   118: 000000000000bc90    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_dispose_op@@PNG16_0   119: 000000000000a2d0    27 FUNC    GLOBAL DEFAULT   15 png_get_color_type@@PNG16_0   120: 000000000001f480    81 FUNC    GLOBAL DEFAULT   15 png_set_sRGB@@PNG16_0   121: 000000000001fd50    27 FUNC    GLOBAL DEFAULT   15 png_get_user_transform_ptr@@PNG16_0   122: 000000000000b070   152 FUNC    GLOBAL DEFAULT   15 png_get_iCCP@@PNG16_0   123: 000000000002aa20   297 FUNC    GLOBAL DEFAULT   15 png_destroy_write_struct@@PNG16_0   124: 0000000000015570    72 FUNC    GLOBAL DEFAULT   15 png_set_expand_gray_1_2_4_to_8@@PNG16_0   125: 000000000000a220    27 FUNC    GLOBAL DEFAULT   15 png_get_rowbytes@@PNG16_0   126: 0000000000024c00    26 FUNC    GLOBAL DEFAULT   15 png_create_write_struct@@PNG16_0   127: 000000000001f5b0    24 FUNC    GLOBAL DEFAULT   15 png_set_read_user_chunk_fn@@PNG16_0   128: 00000000000292e0   584 FUNC    GLOBAL DEFAULT   15 png_set_iCCP@@PNG16_0   129: 000000000000a330    27 FUNC    GLOBAL DEFAULT   15 png_get_compression_type@@PNG16_0   130: 00000000000156c0   379 FUNC    GLOBAL DEFAULT   15 png_set_rgb_to_gray_fixed@@PNG16_0   131: 0000000000007550    58 FUNC    GLOBAL DEFAULT   15 png_longjmp@@PNG16_0   132: 000000000000a3d0    66 FUNC    GLOBAL DEFAULT   15 png_get_pixels_per_meter@@PNG16_0   133: 0000000000024e80    97 FUNC    GLOBAL DEFAULT   15 png_set_compression_window_bits@@PNG16_0   134: 0000000000007590   105 FUNC    GLOBAL DEFAULT   15 png_error@@PNG16_0   135: 0000000000015840   285 FUNC    GLOBAL DEFAULT   15 png_set_rgb_to_gray@@PNG16_0   136: 000000000000b9f0    11 FUNC    GLOBAL DEFAULT   15 png_get_io_state@@PNG16_0   137: 000000000001feb0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_mem_level@@PNG16_0   138: 00000000000206a0    93 FUNC    GLOBAL DEFAULT   15 png_write_chunk@@PNG16_0   139: 000000000001f590    27 FUNC    GLOBAL DEFAULT   15 png_permit_mng_features@@PNG16_0   140: 000000000001ff20   9 FUNC    GLOBAL DEFAULT   15 png_save_uint_32@@PNG16_0   141: 000000000000b780    48 FUNC    GLOBAL DEFAULT   15 png_get_sBIT@@PNG16_0   142: 000000000001f450    48 FUNC    GLOBAL DEFAULT   15 png_set_sBIT@@PNG16_0   143: 000000000000bac0   231 FUNC  GLOBAL DEFAULT   15 png_get_next_frame_fcTL@@PNG16_0   144: 000000000000aac0   187 FUNC    GLOBAL DEFAULT   15 png_get_pHYs_dpi@@PNG16_0   145: 0000000000024ef0    81 FUNC    GLOBAL DEFAULT   15 png_set_compression_method@@PNG16_0   146: 000000000000ba10    30 FUNC    GLOBAL DEFAULT   15 png_get_palette_max@@PNG16_0   147: 0000000000023fa0   377 FUNC    GLOBAL DEFAULT   15 png_set_unknown_chunks@@PNG16_0   148: 0000000000010830   647 FUNC    GLOBAL DEFAULT   15 png_image_finish_read@@PNG16_0   149: 0000000000010260   249 FUNC    GLOBAL DEFAULT   15 png_image_free@@PNG16_0   150: 000000000000abc0  48 FUNC    GLOBAL DEFAULT   15 png_get_bKGD@@PNG16_0   151: 000000000001fe70    16 FUNC    GLOBAL DEFAULT   15 png_set_compression_mem_level@@PNG16_0   152: 000000000000a7e0   218 FUNC    GLOBAL DEFAULT   15 png_get_y_pixels_per_inch@@PNG16_0   153: 000000000001ec90    51 FUNC    GLOBAL DEFAULT   15 png_set_bKGD@@PNG16_0   154: 000000000000b6e0    91 FUNC    GLOBAL DEFAULT   15 png_get_pHYs@@PNG16_0   155: 00000000000241c0   702 FUNC  GLOBAL DEFAULT   15 png_set_keep_unknown_chunks@@PNG16_0   156: 0000000000015380   333 FUNC    GLOBAL DEFAULT   15 png_set_gamma@@PNG16_0   157: 0000000000020450    25 FUNC    GLOBAL DEFAULT   15 png_write_chunk_start@@PNG16_0   158: 000000000001f420    41 FUNC    GLOBAL DEFAULT   15 png_set_pHYs@@PNG16_0   159: 000000000000c9d0   145 FUNC    GLOBAL DEFAULT   15 png_destroy_info_struct@@PNG16_0   160: 0000000000005db0    12 FUNC    GLOBAL DEFAULT   15 png_get_copyright@@PNG16_0   161: 000000000000b800    48 FUNC    GLOBAL DEFAULT   15 png_get_tIME@@PNG16_0   162: 000000000000b420   470 FUNC    GLOBAL DEFAULT   15 png_get_sCAL_fixed@@PNG16_0   163: 000000000000a290    27 FUNC    GLOBAL DEFAULT   15 png_get_image_height@@PNG16_0   164: 000000000002add0   379 FUNC    GLOBAL DEFAULT   15 png_image_write_to_stdio@@PNG16_0   165: 0000000000023df0   108 FUNC  GLOBAL DEFAULT   15 png_set_tIME@@PNG16_0   166: 0000000000005d70    27 FUNC    GLOBAL DEFAULT   15 png_get_io_ptr@@PNG16_0   167: 0000000000015610    72 FUNC    GLOBAL DEFAULT   15 png_set_expand_16@@PNG16_0   168: 000000000000b600   131 FUNC    GLOBAL DEFAULT   15 png_get_sCAL@@PNG16_0   169: 000000000000c1e0    91 FUNC    GLOBAL DEFAULT   15 png_malloc_warn@@PNG16_0   170: 000000000000b910    27 FUNC    GLOBAL DEFAULT   15 png_get_user_chunk_ptr@@PNG16_0   171: 0000000000028f10   238 FUNC    GLOBAL DEFAULT   15 png_set_sCAL@@PNG16_0   172: 000000000000bbb0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_width@@PNG16_0   173: 000000000000d3d0    33 FUNC    GLOBAL DEFAULT   15 png_progressive_combine_row@@PNG16_0   174: 000000000000dc10   800 FUNC    GLOBAL DEFAULT   15 png_read_update_info@@PNG16_0   175: 000000000000bc10    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_y_offset@@PNG16_0   176: 000000000000b930    51 FUNC    GLOBAL DEFAULT   15 png_get_compression_buffer_size@@PNG16_0   177: 0000000000024a90    80 FUNC    GLOBAL DEFAULT   15 png_set_user_transform_info@@PNG16_0   178: 000000000000fd00   217 FUNC    GLOBAL DEFAULT   15 png_set_background_fixed@@PNG16_0   179: 000000000000a700   218 FUNC    GLOBAL DEFAULT   15 png_get_x_pixels_per_inch@@PNG16_0   180: 000000000000b150    27 FUNC  GLOBAL DEFAULT   15 png_get_eXIf@@PNG16_0   181: 0000000000015270   259 FUNC    GLOBAL DEFAULT   15 png_set_gamma_fixed@@PNG16_0   182: 000000000000b8f0    19 FUNC    GLOBAL DEFAULT   15 png_get_rgb_to_gray_status@@PNG16_0   183: 000000000000b1b0    48 FUNC    GLOBAL DEFAULT   15 png_get_hIST@@PNG16_0   184: 0000000000023de0  16 FUNC    GLOBAL DEFAULT   15 png_set_eXIf@@PNG16_0   185: 000000000000b340   215 FUNC    GLOBAL DEFAULT   15 png_get_pCAL@@PNG16_0   186: 00000000000290e0   153 FUNC    GLOBAL DEFAULT   15 png_set_hIST@@PNG16_0   187: 000000000000a1c0    31 FUNC  GLOBAL DEFAULT   15 png_set_error_fn@@PNG16_0   188: 000000000000bcf0    21 FUNC    GLOBAL DEFAULT   15 png_get_first_frame_is_hidden@@PNG16_0   189: 0000000000029cb0  1221 FUNC    GLOBAL DEFAULT   15 png_set_pCAL@@PNG16_0   190: 000000000000a2b0    27 FUNC    GLOBAL DEFAULT   15 png_get_bit_depth@@PNG16_0   191: 000000000001fea0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_level@@PNG16_0   192: 0000000000005df0    84 FUNC    GLOBAL DEFAULT   15 png_build_grayscale_palette@@PNG16_0   193: 000000000001f670    20 FUNC    GLOBAL DEFAULT   15 png_set_check_for_invalid_index@@PNG16_0   194: 000000000002a8a0   384 FUNC    GLOBAL DEFAULT   15 png_set_next_frame_fcTL@@PNG16_0   195: 000000000001fe50     5 FUNC    GLOBAL DEFAULT   15 png_set_filter_heuristics_fixed@@PNG16_0   196: 0000000000005ec0    10 FUNC    GLOBAL DEFAULT   15 png_access_version_number@@PNG16_0   197: 0000000000011a90   221 FUNC  GLOBAL DEFAULT   15 png_read_image@@PNG16_0   198: 00000000000105b0 177 FUNC    GLOBAL DEFAULT   15 png_image_begin_read_from_stdio@@PNG16_0   199: 000000000000bbd0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_height@@PNG16_0   ... // removed because forum dont allow > 2000 char  So for optimization, need to check the source of apngopt.cpp: https://sourceforge.net/projects/apng/files/APNG_Optimizer/1.4/apngopt -1.4-src.zip/download  and see what they do to optimize the size, using methods from library libpng.so/libpng.dll. [EDIT] Included in attachment source of apngopt.cpp.