Pinga/pingo PNG optimizer maybe tit's up. 404!

Dex-chan lover
Joined
Mar 24, 2018
Messages
623
The best optimizer for PNG media files may be no more or at least not supported. I get 404 error on https://css-ig.net/pingo

If this is really the case a file hosting site like fileshare maybe the next thing to get it. If you have a better option let's hear it ? Maybe the MD@Home network could be used?
Latest version 14 was only 2,139,410 bytes. Smaller than some JPG and PNG's I have seen before reduction on Mangadex.
 
Group Leader
Joined
Jan 18, 2018
Messages
818
@doppler This isn't the first time this has happened. Although it is the longest downtime I've seen.
It'll probably eventually return, but cedric is as entirely unpredictable as his genius is unfathomable.
He probably optimized his site right out of existence, who knows.
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
@DrWhoCares I have seen this happen before. When it came back contact, comments, suggestions and fix reports were gone. The help wiki is so out of date, it's not funny anymore. And I still think because it is so small size. Mangadex could host the zip too. I really got into it with another user on mangadex. And we came up with a wonderful bat script to use on the command line. Too bad you can't search by user post. I started a message about compression usage and followed in on another which lead to the script. (btw, cmdow is a fantastic window manipulator. You don't need it to run the script.) I will give you a short cut here:

cmdow @ /mov 1 535 /siz 1400 520
SETLOCAL
SET "sourcedir=%~dp0"
FOR /r "%sourcedir%" %%a IN (*.png) DO (
start "" /normal /wait /min C:\pinga\pingo.exe -q -nodate -pngpalette=40 -notrans -s9 "%%a"
)
rem echo %Time%
rem pause
GOTO :EOF
 
Group Leader
Joined
Jan 18, 2018
Messages
818
@doppler Not gunna lie,that's a pretty atrocious script my man.
Cedric does what he wants, when he wants, however he wants. He giveth and then he taketh away without any warning. Feel blessed you were even born in the Age of Chadric, to be graced by his presence and bequeathed a mere drop in the ocean of quantum wrinkles chadric's brain has to offer.

Also, just use imgdanke.
https://github.com/DrWhoCares/imgdanke/
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
@DrWhoCares The script is right out of examples on sites. I only added from the script the other guy found, and I later found too. "Start" to multitask better "Wait and min" so it doesn't start new cmd terminals equal to the number of PNG's 1500 png's 1500 terminals. "Min" became very important to reduce epileptic seizures. Things were flashing way too much.

Actually the script is very basic. It can go thur all sub directories and do all PNG's unaided. Plus the upside, more cores the faster the results. Would love to have a thread ripper from AMD.
 
Group Leader
Joined
Jan 18, 2018
Messages
818
@doppler Why would it open multiple terminals in the first place?
pingo can work on folders. It's also already multi-threaded by default.
Are you using some sorta decade old version of pingo or something?
That script is really, really awful, even by batch standards.
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
@DrWhoCares The start windows cmdline parameter is a "Start a new terminal occurrence (multi-threading)" using the passed parameters. So in a for do loop. It's a fast start,loop,start,loop ... ETC. Without the passed command to "start" /wait. You get 1500 or whatever windows. If you use the pinga gui interface the parameters "-q -nodate -pngpalette=40 -notrans -s9" they are passed off in a hidden way to execute. You just don't know about it. Then you may ask, "Why don't I just use the GUI pinga interface to do my dirty work?" Well as great as Cedric is his GUI version interface has a real problem with large numbers of pngs compressed. One error and the remain pngs after are not treated. So you got no idea where the error occurred or what files didn't get processed. He was informed via multiple bug reports of this happening, by multiple people. He never got it fixed. But then Cedric did turn off comments/feedback/bug reports. On his website.

Cedric understands compression better than any other programmer out there when it comes to PNG. When it comes down to JPG (via gui interface) he must be using a jpg compression module from someone else (and it sucks the big one). You may ask, who does a great job with JPG? That program is NXpower Lite Desktop. The NXpower guys use "PNGQUANT" as a module. Let's just say it's not a good compressor. If you want to use NXpower lite desktop. That's the first thing to rename in the directory so it's not used. It will throw an exception and complain, so what nothing will come of it.

Hope this helps you understand what goes on "hidden" most of the time. Batch files can get nasty sometimes. But Python scripts take the cake in structured nasty.
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
@Bottersnike I have a 4th gen I7, and yea it does struggle with the max settings. I will take end product over speed any day. Always use a copy of the original to compress. Then copy back after review over writing the larger. Total commander has a nice option feature for just that. The byte count can go down significantly. It's possible for 10:1 sometimes, but then it could be bytes or some K's or no change.

Just try running it on a old Core 2 Duo. That bugger is about 4X slower or worst.

BTW, Everyone the site is back up. It's still the same as always no changes. And on RC14 as before. Just took a hiatus.
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
This is a first time here on MD I am trying this.
Here is an expanded version of PNG reduction project of mine.

This requires QB64 basic.
Get QB64 here: https://github.com/QB64-Phoenix-Edition/QB64pe/releases/tag/v3.4.1

This code uses a external sorter.
Get CMSORT here: http://www.chmaas.handshake.de/delphi/freeware/cmsort/cmsort.htm

Important thing of note:
1. QB64 is required to be installed to compile this code. I think you would not trust me with an executable posted. I wouldn't.
2. CMSORT is required also.
3. This has been optimized for a 24 core i11. You can decrease that in the program.
4. Pingo/pinga is also required. and in a certain directory location.
5. I use a ram drive to contain the optimizing PNG's. No HD trashing. Balls to the wall execution. HD can be used.
6. I have a 4K monitor, so the cmd scripts spread out the executions. In QB64 source the locations can change.
Using a program https://ritchielawrence.github.io/cmdow/
7. These programs and scripts are not for the Novice user. Never used Quickbasic don't read pass here!
8. I will given time try to help answer questions for experienced users.
9. Never double run pingo/pinga. Won't get you extra reduction.
10. Use a copy of the manga content until you are satisfied it's going right.

use this bat to start the cmd's: PS less than 10 cmds. Missing cmd's don't start up.

Code:
start "" /high cmd /c x:kickit0.cmd
start "" /high cmd /c x:kickit1.cmd
start "" /high cmd /c x:kickit2.cmd
start "" /high cmd /c x:kickit3.cmd
start "" /high cmd /c x:kickit4.cmd
start "" /high cmd /c x:kickit5.cmd
start "" /high cmd /c x:kickit6.cmd
start "" /high cmd /c x:kickit7.cmd
start "" /high cmd /c x:kickit8.cmd
start "" /high cmd /c x:kickit9.cmd

Code:
'_Title "Kick it all"
Width 120, 18
_ScreenMove 10, 10

Dim upper_lim, running_count, approx_count, general_count As _Integer64
'upper_lim = 268435456 ' 0.25 GB!
upper_lim = 67108864 ' 0.25/4 GB!

Q$ = Chr$(34)

' clean up any prior messes

ChDir "x:\"
For j = 0 To 9
    name$ = "kickit" + Chr$(48 + j) + ".cmd"
    If _FileExists(name$) Then Kill name$
Next j

'
' get home path
'
homepath$ = Command$(0): p = InStr(homepath$, "\"): home$ = Left$(homepath$, p): p = InStr(p + 1, homepath$, "\"): homepath$ = Left$(homepath$, p)

Shell _Hide "dir /d /s > " + homepath$ + "thelist.txt"

Open homepath$ + "thelist.txt" For Binary As #1
Do
    Line Input #1, d$
    p = InStr(d$, "Total Files Listed:")
Loop Until p <> 0

' get one more line (one we want)
Line Input #1, d$
Close 1

' work out the byte count total
p = InStr(d$, "(s)")
d$ = Right$(d$, Len(d$) - (p + 3))
p = InStr(d$, " bytes")
d$ = Left$(d$, p - 1)
' remove commas
Do
    p = InStr(d$, ",")
    If p = 0 Then Exit Do
    d$ = Left$(d$, p - 1) + Right$(d$, Len(d$) - p)
Loop

approx_count = Val(d$)

If approx_count < 400 Then GoTo skip_approx
general_count = approx_count / 10
gc$ = "For byte count of " + d$ + " suggest a lim total => " + Str$(general_count / upper_lim) + " (1-40)"

skip_approx:
iq$ = _InputBox$("GB quarters/4", gc$, "1")
q = Val(iq$)

If q = 0 Then System
If q < 0 Then Run
If q > 20 Then Run

upper_lim = upper_lim * q

ChDir "x:\"
Shell _Hide "dir *. /b > " + homepath$ + "thelist.txt"

Open homepath$ + "thelist.txt" For Binary As #1
Open homepath$ + "kickit.sort" For Output As #2

If LOF(1) = 0 Then Print "Sorry nothing to see here, put stuff on x:": End

Do Until EOF(1)

    Line Input #1, f$
    fp$ = "x:\" + f$ + "\"

    ChDir fp$
    Print fp$
    Shell _Hide "dir *.png /b > " + homepath$ + "thelist2.txt"
    Open homepath$ + "thelist2.txt" For Binary As #3
    If LOF(3) = 0 Then Close 3: GoTo whoopsie ' does not contain png's

    Do Until EOF(3)
        Line Input #3, d$
        Print #2, fp$ + d$
    Loop

    whoopsie:
    Close 3

Loop

Close 1, 2, 3

ChDir "x:\"
Shell _Hide "c:\utils\cmsort.exe " + homepath$ + "kickit.sort " + homepath$ + "kickit.txt"

Cls

Open homepath$ + "kickit.txt" For Binary As #3

j = 0
Do
    running_count = 0

    If j < 5 Then x = 1: y = (j * 200) + 10 Else x = 1276: y = (((j - 5) * 200) + 10)
    Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #1
    Print #1, "title kickit" + Chr$(48 + j) + ".cmd"
    Print #1, "x:"
    Print #1, "c:\utils\cmdow @ /mov" + Str$(x) + Str$(y) + " /siz 1281 200"
    Close 1

    Do
        Line Input #3, f$

        Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #2
        Print #2, "start " + Q$ + Q$ + " /high /wait /min C:\pinga\pingo.exe -quiet -pngpalette=40 -s9 " + Q$ + f$ + Q$
        Close 2

        Open f$ For Binary As #2
        running_count = running_count + LOF(2)
        Close 2

        Locate 4 + j, 1
        Print String$(120, " ");
        Locate 4 + j, 1
        Print Using "##########"; running_count;: Print , f$
        If EOF(3) Then killkick j: GoTo exhausted
    Loop Until running_count >= upper_lim

    killkick j
    j = j + 1
Loop Until j = 10

Beep: Print
Print "something wrong with the kickit.txt, did not exhaust before j count maxed out (10)"
Input "<enter> to try again."; j
Run

exhausted:
'
' clean up un exported kickit's
'
If j < 9 Then x = j + 1 Else End

For j = x To 9
    name$ = "kickit" + Chr$(48 + j) + ".cmd"
    If _FileExists(name$) Then Kill name$
Next j

End

Sub killkick (j)
    Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #2
    Print #2, "del " + "kickit" + Chr$(48 + j) + ".cmd"
    Close 2
End Sub
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
Well he done broke all my effort. For maximized compression and making all this work. Stick with the A70 release. Any 1.xx code does not compress or have all the right (good) switches. Any changes in newer 1.xx version got worst IMHO. No option to compress with the same vigor as A70.
If someone wants A70 version, we can find a way to post for all. Maybe a cloud fileserver site ?
 
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
Please previous message about A70 version. I updated the code to reposition less windows on 1920 width or less monitors. Next attempt after I figure it out, how to determine how many cores are available. Right now I assume 1920 or less monitor then less script windows will spawn. Done and modified post. Now anybody can use the code as is. No more modifications needed. Read previous parts of this message post. Get and install support tools, compile the bas code in qb64pe and go to town.
edit---- Had tweak it a bit, was creating 6 script not 5. Kick count starts from zero. So kicks is max-1.
This is the final form of this program. Would love to know, if someone is using it.

Code:
'_Title "Kick it all 2"
Width 120, 18
_ScreenMove 10, 10

Dim upper_lim, running_count, approx_count, general_count As _Integer64
'upper_lim = 268435456 ' 0.25 GB!
upper_lim = 67108864 ' 0.25/4 GB!

Q$ = Chr$(34)

Shell _Hide "echo %NUMBER_OF_PROCESSORS% > cores.txt"

'
' determine # of cores and throttle back reusing variables don't worry
'
Open "cores.txt" For Input As #1
Line Input #1, name$
Close 1

j = Val(name$)
dtw = _DesktopWidth
dth = _DesktopHeight
'
' test numbers
'j = 12
'dtw = 1920
'dth = 1080

If j <= 5 And dtw > 1920 Then kicks = 4: sizing = 200: GoTo cleanup
If j <= 8 And dtw <= 1920 Then kicks = 4: sizing = 100: GoTo cleanup
If j <= 8 And dtw > 1920 Then kicks = 9: sizing = 200: GoTo cleanup
'
' more than 8 cores now just decide sizing
'
If dtw <= 1920 Then kicks = 4: sizing = 100: GoTo cleanup
If dtw > 1920 Then kicks = 9: sizing = 200: GoTo cleanup

' clean up any prior messes

cleanup:

Print "You are running"; j; "cores with a display resolution of"; dtw; "by"; dth
Print "I will create"; kicks; "script windows"
Print sizing

ChDir "x:\"
For j = 0 To 9
    name$ = "kickit" + Chr$(48 + j) + ".cmd"
    If _FileExists(name$) Then Kill name$
Next j

'
' get home path
'
homepath$ = Command$(0): p = InStr(homepath$, "\"): home$ = Left$(homepath$, p): p = InStr(p + 1, homepath$, "\"): homepath$ = Left$(homepath$, p)

Shell _Hide "dir /d /s > " + homepath$ + "thelist.txt"

Open homepath$ + "thelist.txt" For Binary As #1
Do
    Line Input #1, d$
    p = InStr(d$, "Total Files Listed:")
Loop Until p <> 0

' get one more line (one we want)
Line Input #1, d$
Close 1

' work out the byte count total
p = InStr(d$, "(s)")
d$ = Right$(d$, Len(d$) - (p + 3))
p = InStr(d$, " bytes")
d$ = Left$(d$, p - 1)
' remove commas
Do
    p = InStr(d$, ",")
    If p = 0 Then Exit Do
    d$ = Left$(d$, p - 1) + Right$(d$, Len(d$) - p)
Loop

approx_count = Val(d$)

If approx_count < 400 Then GoTo skip_approx
general_count = approx_count / (kicks + 1)
gdefault = (general_count / upper_lim)
gc$ = "For byte count of " + d$ + " suggest a lim total => " + Str$(gdefault) + " (1-40)"

skip_approx:
iq$ = _InputBox$("GB quarters/4", gc$, "-1")
If iq$ = "-1" Then q = gdefault: GoTo valid_input
q = Val(iq$)

If q = 0 Then System
If q < 0 Then Run
If q > 40 Then Run

valid_input:

upper_lim = upper_lim * q

ChDir "x:\"
Shell _Hide "dir *. /b > " + homepath$ + "thelist.txt"

Open homepath$ + "thelist.txt" For Binary As #1
Open homepath$ + "kickit.sort" For Output As #2

If LOF(1) = 0 Then Print "Sorry nothing to see here, put stuff on x:": End

Do Until EOF(1)

    Line Input #1, f$
    fp$ = "x:\" + f$ + "\"

    ChDir fp$
    Print fp$
    Shell _Hide "dir *.png /b > " + homepath$ + "thelist2.txt"
    Open homepath$ + "thelist2.txt" For Binary As #3
    If LOF(3) = 0 Then Close 3: GoTo whoopsie ' does not contain png's

    Do Until EOF(3)
        Line Input #3, d$
        Print #2, fp$ + d$
    Loop

    whoopsie:
    Close 3

Loop

Close 1, 2, 3

ChDir "x:\"
Shell _Hide "c:\utils\cmsort.exe " + homepath$ + "kickit.sort " + homepath$ + "kickit.txt"

Cls

Open homepath$ + "kickit.txt" For Binary As #3

j = 0
Do
    running_count = 0

    If j < 5 Then x = 1: y = (j * sizing) + 10 Else x = 1276: y = (((j - 5) * sizing) + 10)
    Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #1
    Print #1, "title kickit" + Chr$(48 + j) + ".cmd"
    Print #1, "x:"
    Print #1, "c:\utils\cmdow @ /mov" + Str$(x) + Str$(y) + " /siz 1281"; sizing
    Close 1

    Do
        Line Input #3, f$

        Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #2
        Print #2, "start " + Q$ + Q$ + " /high /wait /min C:\pinga\pingo.exe -quiet -pngpalette=40 -s9 " + Q$ + f$ + Q$
        Close 2

        Open f$ For Binary As #2
        running_count = running_count + LOF(2)
        Close 2

        Locate 4 + j, 1
        Print String$(120, " ");
        Locate 4 + j, 1
        Print Using "##########"; running_count;: Print , f$
        If EOF(3) Then killkick j: GoTo exhausted
    Loop Until running_count >= upper_lim

    killkick j
    j = j + 1
Loop Until j = kicks + 1

Beep: Print
Print "something wrong with the kickit.txt, did not exhaust before j count maxed out"; kicks + 1
Input "<enter> to try again."; j
Run

exhausted:
'
' clean up un exported kickit's
'
If j < kicks Then
    Print
    Input "One chance, run again "; Q$
    If UCase$(Q$) = "Y" Then Run
End If

If j < kicks Then x = j + 1 Else End

For j = x To kicks
    name$ = "kickit" + Chr$(48 + j) + ".cmd"
    If _FileExists(name$) Then Kill name$
Next j

End

Sub killkick (j)
    Open "kickit" + Chr$(48 + j) + ".cmd" For Append As #2
    Print #2, "del " + "kickit" + Chr$(48 + j) + ".cmd"
    Close 2
End Sub
 
Last edited:
Dex-chan lover
Joined
Mar 24, 2018
Messages
623
Can't edit anymore too long ago ?

so change this in: (kick it all 2)
Shell _Hide "dir *. /b > " + homepath$ + "thelist.txt"

to this:
Shell _Hide "dir /b > " + homepath$ + "thelist.txt"

Simple reason using multiple periods in a name, is legally doable. But not good practice. Error name was missed if it was the case.

----
Around line 120 change to this: (it's only one line add)

If Not _DirExists(fp$) Then GoTo whoopsie
ChDir fp$
Print fp$

allows other than directories to exist in the root.
----

New Version QB64
This requires QB64 basic.
Get QB64 here: https://github.com/QB64-Phoenix-Edition/QB64pe/releases/tag/v3.9.1

pinga a70:
http://depositfiles.com/files/pwgfakx25
 
Last edited:

Users who are viewing this thread

Top