Recent

Author Topic: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?  (Read 1528 times)

Boleeman

  • Hero Member
  • *****
  • Posts: 686
Re: Animated Gif and Animated Png from Image Folders
« Reply #15 on: September 07, 2024, 12:54:56 am »
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

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Animated Gif and Animated Png from Image Folders
« Reply #16 on: September 07, 2024, 02:27:28 am »
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 ?

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

  • Hero Member
  • *****
  • Posts: 3362
    • StrumPract is the musicians best friend
Re: Animated Gif and Animated Png from Image Folders
« Reply #17 on: September 07, 2024, 02:53:17 am »
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 ?

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.

« Last Edit: September 07, 2024, 04:01:51 am by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?
« Reply #18 on: September 07, 2024, 04:14:25 am »
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

  • Hero Member
  • *****
  • Posts: 686
Re: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?
« Reply #19 on: September 07, 2024, 06:30:23 am »
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][+][-]
  1.  Function Name  Address         Relative Address
  2. png_access_version_number       0x10002610      0x00002610
  3. png_benign_error        0x10006e50      0x00006e50
  4. png_build_grayscale_palette     0x10002520      0x00002520
  5. png_calloc      0x10008b00      0x00008b00
  6. png_chunk_benign_error  0x10007080      0x00007080
  7. png_chunk_error 0x10006ff0      0x00006ff0
  8. png_chunk_warning       0x10007030      0x00007030
  9. png_convert_from_struct_tm      0x10020250      0x00020250
  10. png_convert_from_time_t 0x10020290      0x00020290
  11. png_convert_to_rfc1123  0x10002470      0x00002470
  12. png_convert_to_rfc1123_buffer   0x10002170      0x00002170
  13. png_create_info_struct  0x100018f0      0x000018f0
  14. png_create_read_struct  0x1000a790      0x0000a790
  15. png_create_read_struct_2        0x1000a7b0      0x0000a7b0
  16. png_create_write_struct 0x100202e0      0x000202e0
  17. png_create_write_struct_2       0x10020300      0x00020300
  18. png_data_freer  0x100019f0      0x000019f0
  19. png_destroy_info_struct 0x10001940      0x00001940
  20. png_destroy_read_struct 0x1000bb30      0x0000bb30
  21. png_destroy_write_struct        0x10020aa0      0x00020aa0
  22. png_error       0x10006c30      0x00006c30
  23. png_free        0x100015b0      0x000015b0
  24. png_free_data   0x10001a40      0x00001a40
  25. png_free_default        0x10008c60      0x00008c60
  26. png_get_bit_depth       0x100076b0      0x000076b0
  27. png_get_bKGD    0x10007f30      0x00007f30
  28. png_get_channels        0x10007ef0      0x00007ef0
  29. png_get_cHRM    0x10007f60      0x00007f60
  30. png_get_cHRM_fixed      0x10008210      0x00008210
  31. png_get_cHRM_XYZ        0x10008060      0x00008060
  32. png_get_cHRM_XYZ_fixed  0x10008170      0x00008170
  33. png_get_chunk_cache_max 0x10008a80      0x00008a80
  34. png_get_chunk_malloc_max        0x10008aa0      0x00008aa0
  35. png_get_color_type      0x100076d0      0x000076d0
  36. png_get_compression_buffer_size 0x10008a10      0x00008a10
  37. png_get_compression_type        0x10007730      0x00007730
  38. png_get_copyright       0x100024f0      0x000024f0
  39. png_get_current_pass_number     0x1001f820      0x0001f820
  40. png_get_current_row_number      0x1001f800      0x0001f800
  41. png_get_error_ptr       0x10007460      0x00007460
  42. png_get_filter_type     0x100076f0      0x000076f0
  43. png_get_gAMA    0x100082d0      0x000082d0
  44. png_get_gAMA_fixed      0x100082a0      0x000082a0
  45. png_get_header_ver      0x10002500      0x00002500
  46. png_get_header_version  0x10002510      0x00002510
  47. png_get_hIST    0x10008400      0x00008400
  48. png_get_iCCP    0x10008350      0x00008350
  49. png_get_IHDR    0x10008430      0x00008430
  50. png_get_image_height    0x10007690      0x00007690
  51. png_get_image_width     0x10007670      0x00007670
  52. png_get_int_32  0x10016400      0x00016400
  53. png_get_interlace_type  0x10007710      0x00007710
  54. png_get_io_chunk_type   0x10008ad0      0x00008ad0
  55. png_get_io_ptr  0x10002100      0x00002100
  56. png_get_io_state        0x10008ac0      0x00008ac0
  57. png_get_libpng_ver      0x10002500      0x00002500
  58. png_get_mem_ptr 0x10008cb0      0x00008cb0
  59. png_get_oFFs    0x100084e0      0x000084e0
  60. png_get_palette_max     0x10008ae0      0x00008ae0
  61. png_get_pCAL    0x10008540      0x00008540
  62. png_get_pHYs    0x100087b0      0x000087b0
  63. png_get_pHYs_dpi        0x10007e00      0x00007e00
  64. png_get_pixel_aspect_ratio      0x100077f0      0x000077f0
  65. png_get_pixel_aspect_ratio_fixed        0x10007860      0x00007860
  66. png_get_pixels_per_inch 0x100079f0      0x000079f0
  67. png_get_pixels_per_meter        0x100077b0      0x000077b0
  68. png_get_PLTE    0x10008810      0x00008810
  69. png_get_progressive_ptr 0x10002100      0x00002100
  70. png_get_rgb_to_gray_status      0x100089d0      0x000089d0
  71. png_get_rowbytes        0x10007630      0x00007630
  72. png_get_rows    0x10007650      0x00007650
  73. png_get_sBIT    0x10008850      0x00008850
  74. png_get_sCAL    0x10008700      0x00008700
  75. png_get_sCAL_fixed      0x100085f0      0x000085f0
  76. png_get_sCAL_s  0x10008760      0x00008760
  77. png_get_signature       0x10007f10      0x00007f10
  78. png_get_sPLT    0x100083d0      0x000083d0
  79. png_get_sRGB    0x10008310      0x00008310
  80. png_get_text    0x10008880      0x00008880
  81. png_get_tIME    0x100088d0      0x000088d0
  82. png_get_tRNS    0x10008910      0x00008910
  83. png_get_uint_16 0x10016430      0x00016430
  84. png_get_uint_31 0x100163c0      0x000163c0
  85. png_get_uint_32 0x10016400      0x00016400
  86. png_get_unknown_chunks  0x100089a0      0x000089a0
  87. png_get_user_chunk_ptr  0x100089f0      0x000089f0
  88. png_get_user_height_max 0x10008a60      0x00008a60
  89. png_get_user_transform_ptr      0x1001f7e0      0x0001f7e0
  90. png_get_user_width_max  0x10008a40      0x00008a40
  91. png_get_valid   0x10007610      0x00007610
  92. png_get_x_offset_inches 0x10007d60      0x00007d60
  93. png_get_x_offset_inches_fixed   0x10007ce0      0x00007ce0
  94. png_get_x_offset_microns        0x10007930      0x00007930
  95. png_get_x_offset_pixels 0x10007990      0x00007990
  96. png_get_x_pixels_per_inch       0x10007ab0      0x00007ab0
  97. png_get_x_pixels_per_meter      0x10007750      0x00007750
  98. png_get_y_offset_inches 0x10007db0      0x00007db0
  99. png_get_y_offset_inches_fixed   0x10007d20      0x00007d20
  100. png_get_y_offset_microns        0x10007960      0x00007960
  101. png_get_y_offset_pixels 0x100079c0      0x000079c0
  102. png_get_y_pixels_per_inch       0x10007b60      0x00007b60
  103. png_get_y_pixels_per_meter      0x10007780      0x00007780
  104. png_handle_as_unknown   0x100025b0      0x000025b0
  105. png_image_begin_read_from_file  0x1000c470      0x0000c470
  106. png_image_begin_read_from_memory        0x1000c600      0x0000c600
  107. png_image_begin_read_from_stdio 0x1000c3b0      0x0000c3b0
  108. png_image_finish_read   0x1000ff80      0x0000ff80
  109. png_image_free  0x10006be0      0x00006be0
  110. png_image_write_to_file 0x10022fe0      0x00022fe0
  111. png_image_write_to_stdio        0x10022ea0      0x00022ea0
  112. png_info_init_3 0x100019a0      0x000019a0
  113. png_init_io     0x10002120      0x00002120
  114. png_longjmp     0x10007410      0x00007410
  115. png_malloc      0x10008b60      0x00008b60
  116. png_malloc_default      0x10008bb0      0x00008bb0
  117. png_malloc_warn 0x10008be0      0x00008be0
  118. png_permit_mng_features 0x1001eb90      0x0001eb90
  119. png_process_data        0x10008cd0      0x00008cd0
  120. png_process_data_pause  0x10008e20      0x00008e20
  121. png_process_data_skip   0x10008e60      0x00008e60
  122. png_progressive_combine_row     0x1000a6d0      0x0000a6d0
  123. png_read_end    0x1000b470      0x0000b470
  124. png_read_image  0x1000b360      0x0000b360
  125. png_read_info   0x1000a870      0x0000a870
  126. png_read_png    0x1000bc90      0x0000bc90
  127. png_read_row    0x1000adb0      0x0000adb0
  128. png_read_rows   0x1000b2d0      0x0000b2d0
  129. png_read_update_info    0x1000acc0      0x0000acc0
  130. png_reset_zstream       0x100025f0      0x000025f0
  131. png_save_int_32 0x10002140      0x00002140
  132. png_save_uint_16        0x10023870      0x00023870
  133. png_save_uint_32        0x10023840      0x00023840
  134. png_set_add_alpha       0x1001f250      0x0001f250
  135. png_set_alpha_mode      0x10010860      0x00010860
  136. png_set_alpha_mode_fixed        0x10010640      0x00010640
  137. png_set_background      0x10010430      0x00010430
  138. png_set_background_fixed        0x10010330      0x00010330
  139. png_set_benign_errors   0x1001f050      0x0001f050
  140. png_set_bgr     0x1001f0a0      0x0001f0a0
  141. png_set_bKGD    0x1001bd60      0x0001bd60
  142. png_set_check_for_invalid_index 0x1001f080      0x0001f080
  143. png_set_cHRM    0x1001c040      0x0001c040
  144. png_set_cHRM_fixed      0x1001bda0      0x0001bda0
  145. png_set_cHRM_XYZ        0x1001c3b0      0x0001c3b0
  146. png_set_cHRM_XYZ_fixed  0x1001be90      0x0001be90
  147. png_set_chunk_cache_max 0x1001f010      0x0001f010
  148. png_set_chunk_malloc_max        0x1001f030      0x0001f030
  149. png_set_compression_buffer_size 0x1001eee0      0x0001eee0
  150. png_set_compression_level       0x10021540      0x00021540
  151. png_set_compression_mem_level   0x10021560      0x00021560
  152. png_set_compression_method      0x10021680      0x00021680
  153. png_set_compression_strategy    0x10021580      0x00021580
  154. png_set_compression_window_bits 0x100215a0      0x000215a0
  155. png_set_crc_action      0x10010230      0x00010230
  156. png_set_error_fn        0x10007440      0x00007440
  157. png_set_expand  0x10011520      0x00011520
  158. png_set_expand_16       0x10011620      0x00011620
  159. png_set_expand_gray_1_2_4_to_8  0x100115a0      0x000115a0
  160. png_set_filler  0x1001f170      0x0001f170
  161. png_set_filter  0x10020b90      0x00020b90
  162. png_set_filter_heuristics       0x10021210      0x00021210
  163. png_set_filter_heuristics_fixed 0x10021320      0x00021320
  164. png_set_flush   0x10020820      0x00020820
  165. png_set_gAMA    0x1001c7e0      0x0001c7e0
  166. png_set_gAMA_fixed      0x1001c750      0x0001c750
  167. png_set_gamma   0x10011410      0x00011410
  168. png_set_gamma_fixed     0x10011300      0x00011300
  169. png_set_gray_to_rgb     0x100116a0      0x000116a0
  170. png_set_hIST    0x1001c8e0      0x0001c8e0
  171. png_set_iCCP    0x1001d800      0x0001d800
  172. png_set_IHDR    0x1001ca30      0x0001ca30
  173. png_set_interlace_handling      0x1001f140      0x0001f140
  174. png_set_invalid 0x1001efd0      0x0001efd0
  175. png_set_invert_alpha    0x1001f2a0      0x0001f2a0
  176. png_set_invert_mono     0x1001f2c0      0x0001f2c0
  177. png_set_keep_unknown_chunks     0x1001ebb0      0x0001ebb0
  178. png_set_longjmp_fn      0x100071e0      0x000071e0
  179. png_set_mem_fn  0x10008c80      0x00008c80
  180. png_set_oFFs    0x1001cb00      0x0001cb00
  181. png_set_option  0x10006ac0      0x00006ac0
  182. png_set_packing 0x1001f0d0      0x0001f0d0
  183. png_set_packswap        0x1001f0f0      0x0001f0f0
  184. png_set_palette_to_rgb  0x10011520      0x00011520
  185. png_set_pCAL    0x1001cb40      0x0001cb40
  186. png_set_pHYs    0x1001d500      0x0001d500
  187. png_set_PLTE    0x1001d540      0x0001d540
  188. png_set_progressive_read_fn     0x1000a6f0      0x0000a6f0
  189. png_set_quantize        0x10010900      0x00010900
  190. png_set_read_fn 0x100101a0      0x000101a0
  191. png_set_read_status_fn  0x1000bc70      0x0000bc70
  192. png_set_read_user_chunk_fn      0x1001ee70      0x0001ee70
  193. png_set_read_user_transform_fn  0x10011a20      0x00011a20
  194. png_set_rgb_to_gray     0x10011940      0x00011940
  195. png_set_rgb_to_gray_fixed       0x100117a0      0x000117a0
  196. png_set_rows    0x1001ee90      0x0001ee90
  197. png_set_sBIT    0x1001d6a0      0x0001d6a0
  198. png_set_sCAL    0x1001d2e0      0x0001d2e0
  199. png_set_sCAL_fixed      0x1001d400      0x0001d400
  200. png_set_sCAL_s  0x1001cfe0      0x0001cfe0
  201. png_set_scale_16        0x100104c0      0x000104c0
  202. png_set_shift   0x1001f110      0x0001f110
  203. png_set_sig_bytes       0x100013f0      0x000013f0
  204. png_set_sPLT    0x1001e350      0x0001e350
  205. png_set_sRGB    0x1001d6d0      0x0001d6d0
  206. png_set_sRGB_gAMA_and_cHRM      0x1001d760      0x0001d760
  207. png_set_strip_16        0x10010540      0x00010540
  208. png_set_strip_alpha     0x100105c0      0x000105c0
  209. png_set_swap    0x1001f0b0      0x0001f0b0
  210. png_set_swap_alpha      0x1001f280      0x0001f280
  211. png_set_text    0x1001db70      0x0001db70
  212. png_set_text_compression_level  0x100216f0      0x000216f0
  213. png_set_text_compression_mem_level      0x10021710      0x00021710
  214. png_set_text_compression_method 0x10021830      0x00021830
  215. png_set_text_compression_strategy       0x10021730      0x00021730
  216. png_set_text_compression_window_bits    0x10021750      0x00021750
  217. png_set_tIME    0x1001e110      0x0001e110
  218. png_set_tRNS    0x1001e1d0      0x0001e1d0
  219. png_set_tRNS_to_alpha   0x10011520      0x00011520
  220. png_set_unknown_chunk_location  0x1001ead0      0x0001ead0
  221. png_set_unknown_chunks  0x1001e7b0      0x0001e7b0
  222. png_set_user_limits     0x1001eff0      0x0001eff0
  223. png_set_user_transform_info     0x1001f750      0x0001f750
  224. png_set_write_fn        0x1001f8a0      0x0001f8a0
  225. png_set_write_status_fn 0x100218a0      0x000218a0
  226. png_set_write_user_transform_fn 0x100218c0      0x000218c0
  227. png_sig_cmp     0x10001430      0x00001430
  228. png_start_read_image    0x1000ad40      0x0000ad40
  229. png_warning     0x10006dc0      0x00006dc0
  230. png_write_chunk 0x10023bf0      0x00023bf0
  231. png_write_chunk_data    0x10023a30      0x00023a30
  232. png_write_chunk_end     0x10023ab0      0x00023ab0
  233. png_write_chunk_start   0x100239f0      0x000239f0
  234. png_write_end   0x100200b0      0x000200b0
  235. png_write_flush 0x10020840      0x00020840
  236. png_write_image 0x10020450      0x00020450
  237. png_write_info  0x1001fcf0      0x0001fcf0
  238. png_write_info_before_PLTE      0x1001fa60      0x0001fa60
  239. png_write_png   0x100218e0      0x000218e0
  240. png_write_row   0x100204c0      0x000204c0
  241. png_write_rows  0x10020420      0x00020420
  242. png_write_sig   0x10023890      0x00023890  
« Last Edit: September 07, 2024, 08:33:37 am by Boleeman »

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?
« Reply #20 on: September 07, 2024, 01:29:04 pm »
AFAIK C# dll can't be used with FPC.

Thaddy

  • Hero Member
  • *****
  • Posts: 15722
  • Censorship about opinions does not belong here.
Re: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?
« Reply #21 on: September 07, 2024, 02:04:21 pm »
AFAIK 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.
« Last Edit: September 07, 2024, 02:25:21 pm by Thaddy »
If I smell bad code it usually is bad code and that includes my own code.

Fred vS

  • Hero Member
  • *****
  • Posts: 3362
    • StrumPract is the musicians best friend
Re: Animated Gif and Animated Png from Image Folders: Can APNG be Optimized?
« Reply #22 on: September 07, 2024, 03:17:19 pm »
Here 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][+][-]
  1.  $ readelf --dyn-syms -W /usr/lib/x86_64-linux-gnu/libpng16.so.16 | grep png
  2.     46: 000000000000a470   230 FUNC    GLOBAL DEFAULT   15 png_get_pixel_aspect_ratio_fixed@@PNG16_0
  3.     47: 00000000000079e0    93 FUNC    GLOBAL DEFAULT   15 png_benign_error@@PNG16_0
  4.     48: 000000000000abf0   289 FUNC    GLOBAL DEFAULT   15 png_get_cHRM@@PNG16_0
  5.     49: 000000000000f2e0  1498 FUNC    GLOBAL DEFAULT   15 png_read_end@@PNG16_0
  6.     50: 0000000000005b50   140 FUNC    GLOBAL DEFAULT   15 png_sig_cmp@@PNG16_0
  7.     51: 000000000001ed70  1163 FUNC    GLOBAL DEFAULT   15 png_set_cHRM@@PNG16_0
  8.     52: 000000000000c380    45 FUNC    GLOBAL DEFAULT   15 png_free@@PNG16_0
  9.     53: 000000000000fed0    72 FUNC    GLOBAL DEFAULT   15 png_set_strip_16@@PNG16_0
  10.     54: 000000000000df80  1220 FUNC    GLOBAL DEFAULT   15 png_read_row@@PNG16_0
  11.     55: 0000000000027310    65 FUNC    GLOBAL DEFAULT   15 png_write_rows@@PNG16_0
  12.     56: 0000000000024fc0    81 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_method@@PNG16_0
  13.     57: 0000000000027360   107 FUNC    GLOBAL DEFAULT   15 png_write_image@@PNG16_0
  14.     58: 000000000000bbf0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_x_offset@@PNG16_0
  15.     59: 000000000000a590    39 FUNC    GLOBAL DEFAULT   15 png_get_y_offset_microns@@PNG16_0
  16.     60: 000000000000b2c0   114 FUNC    GLOBAL DEFAULT   15 png_get_oFFs@@PNG16_0
  17.     61: 000000000001f610    16 FUNC    GLOBAL DEFAULT   15 png_set_chunk_cache_max@@PNG16_0
  18.     62: 000000000000ad20   323 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_XYZ@@PNG16_0
  19.     63: 000000000001fec0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_strategy@@PNG16_0
  20.     64: 000000000000df30    70 FUNC    GLOBAL DEFAULT   15 png_start_read_image@@PNG16_0
  21.     65: 000000000001f3f0    41 FUNC    GLOBAL DEFAULT   15 png_set_oFFs@@PNG16_0
  22.     66: 0000000000005de0    12 FUNC    GLOBAL DEFAULT   15 png_get_header_version@@PNG16_0
  23.     67: 000000000002af50   364 FUNC    GLOBAL DEFAULT   15 png_image_write_to_file@@PNG16_0
  24.     68: 000000000001ff30    12 FUNC    GLOBAL DEFAULT   15 png_save_uint_16@@PNG16_0
  25.     69: 0000000000006e60    86 FUNC    GLOBAL DEFAULT   15 png_set_option@@PNG16_0
  26.     70: 0000000000028c00   175 FUNC    GLOBAL DEFAULT   15 png_set_eXIf_1@@PNG16_0
  27.     71: 0000000000028cb0   607 FUNC    GLOBAL DEFAULT   15 png_set_sCAL_s@@PNG16_0
  28.     72: 000000000000bcc0    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_blend_op@@PNG16_0
  29.     73: 00000000000256d0    81 FUNC    GLOBAL DEFAULT   15 png_write_flush@@PNG16_0
  30.     74: 000000000000d350    68 FUNC    GLOBAL DEFAULT   15 png_process_data_pause@@PNG16_0
  31.     75: 000000000001fe60    16 FUNC    GLOBAL DEFAULT   15 png_set_compression_level@@PNG16_0
  32.     76: 00000000000154d0    72 FUNC    GLOBAL DEFAULT   15 png_set_expand@@PNG16_0
  33.     77: 000000000000af30   154 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_fixed@@PNG16_0
  34.     78: 0000000000005dc0    12 FUNC    GLOBAL DEFAULT   15 png_get_header_ver@@PNG16_0
  35.     79: 000000000001f620    17 FUNC    GLOBAL DEFAULT   15 png_set_chunk_malloc_max@@PNG16_0
  36.     80: 0000000000005d90    17 FUNC    GLOBAL DEFAULT   15 png_init_io@@PNG16_0
  37.     81: 000000000000b9d0    19 FUNC    GLOBAL DEFAULT   15 png_get_chunk_malloc_max@@PNG16_0
  38.     82: 0000000000014690    22 FUNC    GLOBAL DEFAULT   15 png_set_read_user_transform_fn@@PNG16_0
  39.     83: 000000000001f5d0    20 FUNC    GLOBAL DEFAULT   15 png_set_invalid@@PNG16_0
  40.     84: 000000000001fe20    23 FUNC    GLOBAL DEFAULT   15 png_set_flush@@PNG16_0
  41.     85: 000000000000f8c0   465 FUNC    GLOBAL DEFAULT   15 png_destroy_read_struct@@PNG16_0
  42.     86: 0000000000006f90  1086 FUNC    GLOBAL DEFAULT   15 png_convert_to_rfc1123_buffer@@PNG16_0
  43.     87: 000000000000a2f0    27 FUNC    GLOBAL DEFAULT   15 png_get_filter_type@@PNG16_0
  44.     88: 000000000000da50   445 FUNC    GLOBAL DEFAULT   15 png_read_frame_head@@PNG16_0
  45.     89: 000000000001fe80    23 FUNC    GLOBAL DEFAULT   15 png_set_compression_strategy@@PNG16_0
  46.     90: 000000000000b170    56 FUNC    GLOBAL DEFAULT   15 png_get_eXIf_1@@PNG16_0
  47.     91: 000000000000b690    75 FUNC    GLOBAL DEFAULT   15 png_get_sCAL_s@@PNG16_0
  48.     92: 000000000000aba0    27 FUNC    GLOBAL DEFAULT   15 png_get_signature@@PNG16_0
  49.     93: 000000000000fb70    77 FUNC    GLOBAL DEFAULT   15 png_create_read_struct_2@@PNG16_0
  50.     94: 000000000000faa0    17 FUNC    GLOBAL DEFAULT   15 png_set_read_status_fn@@PNG16_0
  51.     95: 000000000002b1c0  1956 FUNC    GLOBAL DEFAULT   15 png_write_info_before_PLTE@@PNG16_0
  52.     96: 00000000000155c0    72 FUNC    GLOBAL DEFAULT   15 png_set_tRNS_to_alpha@@PNG16_0
  53.     97: 00000000000074b0   153 FUNC    GLOBAL DEFAULT   15 png_chunk_warning@@PNG16_0
  54.     98: 0000000000018af0    50 FUNC    GLOBAL DEFAULT   15 png_get_uint_31@@PNG16_0
  55.     99: 00000000000146b0    35 FUNC    GLOBAL DEFAULT   15 png_get_uint_32@@PNG16_0
  56.    100: 000000000002c7e0   677 FUNC    GLOBAL DEFAULT   15 png_write_end@@PNG16_0
  57.    101: 000000000000aa60    38 FUNC    GLOBAL DEFAULT   15 png_get_x_offset_inches@@PNG16_0
  58.    102: 000000000000ae70   179 FUNC    GLOBAL DEFAULT   15 png_get_cHRM_XYZ_fixed@@PNG16_0
  59.    103: 000000000000ab80    27 FUNC    GLOBAL DEFAULT   15 png_get_channels@@PNG16_0
  60.    104: 0000000000020510    93 FUNC    GLOBAL DEFAULT   15 png_write_chunk_data@@PNG16_0
  61.    105: 000000000001fef0    27 FUNC    GLOBAL DEFAULT   15 png_set_write_user_transform_fn@@PNG16_0
  62.    106: 00000000000258b0  6752 FUNC    GLOBAL DEFAULT   15 png_write_row@@PNG16_0
  63.    107: 0000000000010750   215 FUNC    GLOBAL DEFAULT   15 png_image_begin_read_from_memory@@PNG16_0
  64.    108: 000000000001fe40     5 FUNC    GLOBAL DEFAULT   15 png_set_filter_heuristics@@PNG16_0
  65.    109: 000000000000baa0    27 FUNC    GLOBAL DEFAULT   15 png_get_num_plays@@PNG16_0
  66.    110: 000000000000ba00    11 FUNC    GLOBAL DEFAULT   15 png_get_io_chunk_type@@PNG16_0
  67.    111: 000000000000ced0    31 FUNC    GLOBAL DEFAULT   15 png_set_mem_fn@@PNG16_0
  68.    112: 000000000001fd70    21 FUNC    GLOBAL DEFAULT   15 png_get_current_row_number@@PNG16_0
  69.    113: 000000000000bc60    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_delay_den@@PNG16_0
  70.    114: 000000000000b040    44 FUNC    GLOBAL DEFAULT   15 png_get_sRGB@@PNG16_0
  71.    115: 000000000000b990    18 FUNC    GLOBAL DEFAULT   15 png_get_user_height_max@@PNG16_0
  72.    116: 0000000000024480   213 FUNC    GLOBAL DEFAULT   15 png_set_compression_buffer_size@@PNG16_0
  73.    117: 000000000001f200    81 FUNC    GLOBAL DEFAULT   15 png_set_gAMA_fixed@@PNG16_0
  74.    118: 000000000000bc90    35 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_dispose_op@@PNG16_0
  75.    119: 000000000000a2d0    27 FUNC    GLOBAL DEFAULT   15 png_get_color_type@@PNG16_0
  76.    120: 000000000001f480    81 FUNC    GLOBAL DEFAULT   15 png_set_sRGB@@PNG16_0
  77.    121: 000000000001fd50    27 FUNC    GLOBAL DEFAULT   15 png_get_user_transform_ptr@@PNG16_0
  78.    122: 000000000000b070   152 FUNC    GLOBAL DEFAULT   15 png_get_iCCP@@PNG16_0
  79.    123: 000000000002aa20   297 FUNC    GLOBAL DEFAULT   15 png_destroy_write_struct@@PNG16_0
  80.    124: 0000000000015570    72 FUNC    GLOBAL DEFAULT   15 png_set_expand_gray_1_2_4_to_8@@PNG16_0
  81.    125: 000000000000a220    27 FUNC    GLOBAL DEFAULT   15 png_get_rowbytes@@PNG16_0
  82.    126: 0000000000024c00    26 FUNC    GLOBAL DEFAULT   15 png_create_write_struct@@PNG16_0
  83.    127: 000000000001f5b0    24 FUNC    GLOBAL DEFAULT   15 png_set_read_user_chunk_fn@@PNG16_0
  84.    128: 00000000000292e0   584 FUNC    GLOBAL DEFAULT   15 png_set_iCCP@@PNG16_0
  85.    129: 000000000000a330    27 FUNC    GLOBAL DEFAULT   15 png_get_compression_type@@PNG16_0
  86.    130: 00000000000156c0   379 FUNC    GLOBAL DEFAULT   15 png_set_rgb_to_gray_fixed@@PNG16_0
  87.    131: 0000000000007550    58 FUNC    GLOBAL DEFAULT   15 png_longjmp@@PNG16_0
  88.    132: 000000000000a3d0    66 FUNC    GLOBAL DEFAULT   15 png_get_pixels_per_meter@@PNG16_0
  89.    133: 0000000000024e80    97 FUNC    GLOBAL DEFAULT   15 png_set_compression_window_bits@@PNG16_0
  90.    134: 0000000000007590   105 FUNC    GLOBAL DEFAULT   15 png_error@@PNG16_0
  91.    135: 0000000000015840   285 FUNC    GLOBAL DEFAULT   15 png_set_rgb_to_gray@@PNG16_0
  92.    136: 000000000000b9f0    11 FUNC    GLOBAL DEFAULT   15 png_get_io_state@@PNG16_0
  93.    137: 000000000001feb0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_mem_level@@PNG16_0
  94.    138: 00000000000206a0    93 FUNC    GLOBAL DEFAULT   15 png_write_chunk@@PNG16_0
  95.    139: 000000000001f590    27 FUNC    GLOBAL DEFAULT   15 png_permit_mng_features@@PNG16_0
  96.    140: 000000000001ff20     9 FUNC    GLOBAL DEFAULT   15 png_save_uint_32@@PNG16_0
  97.    141: 000000000000b780    48 FUNC    GLOBAL DEFAULT   15 png_get_sBIT@@PNG16_0
  98.    142: 000000000001f450    48 FUNC    GLOBAL DEFAULT   15 png_set_sBIT@@PNG16_0
  99.    143: 000000000000bac0   231 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_fcTL@@PNG16_0
  100.    144: 000000000000aac0   187 FUNC    GLOBAL DEFAULT   15 png_get_pHYs_dpi@@PNG16_0
  101.    145: 0000000000024ef0    81 FUNC    GLOBAL DEFAULT   15 png_set_compression_method@@PNG16_0
  102.    146: 000000000000ba10    30 FUNC    GLOBAL DEFAULT   15 png_get_palette_max@@PNG16_0
  103.    147: 0000000000023fa0   377 FUNC    GLOBAL DEFAULT   15 png_set_unknown_chunks@@PNG16_0
  104.    148: 0000000000010830   647 FUNC    GLOBAL DEFAULT   15 png_image_finish_read@@PNG16_0
  105.    149: 0000000000010260   249 FUNC    GLOBAL DEFAULT   15 png_image_free@@PNG16_0
  106.    150: 000000000000abc0    48 FUNC    GLOBAL DEFAULT   15 png_get_bKGD@@PNG16_0
  107.    151: 000000000001fe70    16 FUNC    GLOBAL DEFAULT   15 png_set_compression_mem_level@@PNG16_0
  108.    152: 000000000000a7e0   218 FUNC    GLOBAL DEFAULT   15 png_get_y_pixels_per_inch@@PNG16_0
  109.    153: 000000000001ec90    51 FUNC    GLOBAL DEFAULT   15 png_set_bKGD@@PNG16_0
  110.    154: 000000000000b6e0    91 FUNC    GLOBAL DEFAULT   15 png_get_pHYs@@PNG16_0
  111.    155: 00000000000241c0   702 FUNC    GLOBAL DEFAULT   15 png_set_keep_unknown_chunks@@PNG16_0
  112.    156: 0000000000015380   333 FUNC    GLOBAL DEFAULT   15 png_set_gamma@@PNG16_0
  113.    157: 0000000000020450    25 FUNC    GLOBAL DEFAULT   15 png_write_chunk_start@@PNG16_0
  114.    158: 000000000001f420    41 FUNC    GLOBAL DEFAULT   15 png_set_pHYs@@PNG16_0
  115.    159: 000000000000c9d0   145 FUNC    GLOBAL DEFAULT   15 png_destroy_info_struct@@PNG16_0
  116.    160: 0000000000005db0    12 FUNC    GLOBAL DEFAULT   15 png_get_copyright@@PNG16_0
  117.    161: 000000000000b800    48 FUNC    GLOBAL DEFAULT   15 png_get_tIME@@PNG16_0
  118.    162: 000000000000b420   470 FUNC    GLOBAL DEFAULT   15 png_get_sCAL_fixed@@PNG16_0
  119.    163: 000000000000a290    27 FUNC    GLOBAL DEFAULT   15 png_get_image_height@@PNG16_0
  120.    164: 000000000002add0   379 FUNC    GLOBAL DEFAULT   15 png_image_write_to_stdio@@PNG16_0
  121.    165: 0000000000023df0   108 FUNC    GLOBAL DEFAULT   15 png_set_tIME@@PNG16_0
  122.    166: 0000000000005d70    27 FUNC    GLOBAL DEFAULT   15 png_get_io_ptr@@PNG16_0
  123.    167: 0000000000015610    72 FUNC    GLOBAL DEFAULT   15 png_set_expand_16@@PNG16_0
  124.    168: 000000000000b600   131 FUNC    GLOBAL DEFAULT   15 png_get_sCAL@@PNG16_0
  125.    169: 000000000000c1e0    91 FUNC    GLOBAL DEFAULT   15 png_malloc_warn@@PNG16_0
  126.    170: 000000000000b910    27 FUNC    GLOBAL DEFAULT   15 png_get_user_chunk_ptr@@PNG16_0
  127.    171: 0000000000028f10   238 FUNC    GLOBAL DEFAULT   15 png_set_sCAL@@PNG16_0
  128.    172: 000000000000bbb0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_width@@PNG16_0
  129.    173: 000000000000d3d0    33 FUNC    GLOBAL DEFAULT   15 png_progressive_combine_row@@PNG16_0
  130.    174: 000000000000dc10   800 FUNC    GLOBAL DEFAULT   15 png_read_update_info@@PNG16_0
  131.    175: 000000000000bc10    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_y_offset@@PNG16_0
  132.    176: 000000000000b930    51 FUNC    GLOBAL DEFAULT   15 png_get_compression_buffer_size@@PNG16_0
  133.    177: 0000000000024a90    80 FUNC    GLOBAL DEFAULT   15 png_set_user_transform_info@@PNG16_0
  134.    178: 000000000000fd00   217 FUNC    GLOBAL DEFAULT   15 png_set_background_fixed@@PNG16_0
  135.    179: 000000000000a700   218 FUNC    GLOBAL DEFAULT   15 png_get_x_pixels_per_inch@@PNG16_0
  136.    180: 000000000000b150    27 FUNC    GLOBAL DEFAULT   15 png_get_eXIf@@PNG16_0
  137.    181: 0000000000015270   259 FUNC    GLOBAL DEFAULT   15 png_set_gamma_fixed@@PNG16_0
  138.    182: 000000000000b8f0    19 FUNC    GLOBAL DEFAULT   15 png_get_rgb_to_gray_status@@PNG16_0
  139.    183: 000000000000b1b0    48 FUNC    GLOBAL DEFAULT   15 png_get_hIST@@PNG16_0
  140.    184: 0000000000023de0    16 FUNC    GLOBAL DEFAULT   15 png_set_eXIf@@PNG16_0
  141.    185: 000000000000b340   215 FUNC    GLOBAL DEFAULT   15 png_get_pCAL@@PNG16_0
  142.    186: 00000000000290e0   153 FUNC    GLOBAL DEFAULT   15 png_set_hIST@@PNG16_0
  143.    187: 000000000000a1c0    31 FUNC    GLOBAL DEFAULT   15 png_set_error_fn@@PNG16_0
  144.    188: 000000000000bcf0    21 FUNC    GLOBAL DEFAULT   15 png_get_first_frame_is_hidden@@PNG16_0
  145.    189: 0000000000029cb0  1221 FUNC    GLOBAL DEFAULT   15 png_set_pCAL@@PNG16_0
  146.    190: 000000000000a2b0    27 FUNC    GLOBAL DEFAULT   15 png_get_bit_depth@@PNG16_0
  147.    191: 000000000001fea0    16 FUNC    GLOBAL DEFAULT   15 png_set_text_compression_level@@PNG16_0
  148.    192: 0000000000005df0    84 FUNC    GLOBAL DEFAULT   15 png_build_grayscale_palette@@PNG16_0
  149.    193: 000000000001f670    20 FUNC    GLOBAL DEFAULT   15 png_set_check_for_invalid_index@@PNG16_0
  150.    194: 000000000002a8a0   384 FUNC    GLOBAL DEFAULT   15 png_set_next_frame_fcTL@@PNG16_0
  151.    195: 000000000001fe50     5 FUNC    GLOBAL DEFAULT   15 png_set_filter_heuristics_fixed@@PNG16_0
  152.    196: 0000000000005ec0    10 FUNC    GLOBAL DEFAULT   15 png_access_version_number@@PNG16_0
  153.    197: 0000000000011a90   221 FUNC    GLOBAL DEFAULT   15 png_read_image@@PNG16_0
  154.    198: 00000000000105b0   177 FUNC    GLOBAL DEFAULT   15 png_image_begin_read_from_stdio@@PNG16_0
  155.    199: 000000000000bbd0    27 FUNC    GLOBAL DEFAULT   15 png_get_next_frame_height@@PNG16_0
  156.    ... // removed because forum dont allow > 2000 char
  157.  

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.
« Last Edit: September 07, 2024, 03:36:01 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018