03-25-2022, 09:09 PM | #1 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
ashSCII
In case you ever wanted to do such a thing.
You can replace the density map string, just keep a few things in mind: 1) It wants to go big to small like the one I've got in there. I left one blank space at the end, but that's kind of optional, and you could add more if you wanted to. B) Make sure to change the map_length value to match the number of characters in your string, including those trailing blank spaces, but... III) For some reason, the strcpy_substr function was returning nothing when I tried to grab index 1, so I added two blank spaces at the beginning. These are NOT included in map_length, but rather are represented in map_pad. It doesn't make sense that they are necessary, and if it works for you without them, then great! You could of course change the font, too. Monospaced fonts are supposedly best, but... As always, let me know what you think. Edit 15:10CT 3/26/22 - Added a source parameter so it can be on the same track as your video (source = 0), or index to others below it. Code:
// ashSCII //@param1:source 'source (tracks below)' 0 0 50 25 1 //@param2:rez 'resolution' 0.025 0.01 0.05 0.025 0.001 //@param3:mode 'mode' 0 0 1 0 1 //@param4:contrast 'contrast' 1 0 4 2.5 0.1 colorspace = 'RGBA'; //#map=" _.,-=+:;cba!?0123456789$W#@Ñ"; // set to string to override #map = " $@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,'. "; map_length = 66; map_pad = 2; third = 1/3; _8bit = 1/256; value_mult = map_length * _8bit; down_h = rez * project_h; font="Ariel"; gfx_setfont(down_h,font); #text = "@"; gfx_str_measure(#text,txtw,txth); gfx_setfont(down_h,txth); txt_x_pad = 0; txt_y_pad = 0; txt_x = (txtw + txt_x_pad); txt_y = (txth + txt_y_pad); d_x = floor(project_w / txt_x); d_y = floor(project_h / txt_y); temp = gfx_img_resize (temp,d_x,d_y); gfx_dest = temp; gfx_blit (source == 0 ? 0 : input_track(source-1), 0, 0, 0, d_x, d_y); gfx_dest = -1; gfx_set (mode); gfx_fillrect (0,0,project_w,project_h); gfx_set(1-mode); i = 0; while (i < d_x) (j = 0; while (j < d_y) (gfx_getpixel(temp, i, j, r, g, b); value = floor (value_mult * ((0.3 * r + 0.59 * g + 0.11 * b - 127.5) * contrast + 127.5)); mode == 0 ? value = map_length - value; value = max(0, min (map_length, value)); value += map_pad; #text = ""; strcpy_substr(#text,#map,value,1); gfx_str_draw (#text, i*txt_x, j*txt_y); j += 1; ); i += 1; );
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika Last edited by ashcat_lt; 03-26-2022 at 01:12 PM. |
03-26-2022, 12:04 AM | #2 |
Human being with feelings
Join Date: May 2008
Location: Nottingham
Posts: 200
|
Just had a play with ashSCII and it's pretty cool!
|
03-26-2022, 02:29 AM | #3 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Wow, looks amazing!
|
03-26-2022, 02:35 AM | #4 |
Human being with feelings
Join Date: Nov 2010
Location: Mullet
Posts: 829
|
What is this ?
thanks (*im dumb but I want to try this)
__________________
I like turtles Last edited by bezusheist; 03-26-2022 at 02:43 AM. |
03-26-2022, 02:51 AM | #5 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Translates image to ASCII. It was popular > 10 years ago.
|
03-26-2022, 03:54 AM | #6 |
Human being with feelings
Join Date: Nov 2010
Location: Mullet
Posts: 829
|
Is it a script ? What image does it convert ? Do I drag a gif or video onto a track ?
Thanks
__________________
I like turtles |
03-26-2022, 04:33 AM | #7 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Check what subforum you are in. Check it for yourself, I didn't try.
|
03-26-2022, 04:46 AM | #8 |
Human being with feelings
Join Date: Nov 2010
Location: Mullet
Posts: 829
|
Ok thanks for nothing lol
__________________
I like turtles |
03-26-2022, 04:52 AM | #9 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
|
03-26-2022, 06:42 AM | #10 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
It’s a preset for the video processor. Put an image or video on a track. Insert the VP plugin on that track. Copy the code from here into the big blank area in the VP and hit Ctrl+S. View the results in the Video window. In my gif, I have the video window floating above the actual VP window so that you can see it while I turn the knobs.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
03-26-2022, 06:51 AM | #11 |
Human being with feelings
Join Date: Nov 2010
Location: Mullet
Posts: 829
|
Oh good explanation, thanks. I knew it had something to do with video but no idea what was involved.
__________________
I like turtles |
03-26-2022, 07:07 AM | #12 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
Wow!
That brings old memories! Back in the early 80s my father brought back from the university a printout of the famous Einstein's picture in ASCII that he gathered from of printer terminals with no screen.... |
03-26-2022, 07:27 AM | #13 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
I tried but all I get are repetitive patterns, does this code assume a specific video size or format?
btw there is a difference between "RGBA" and 'RGBA', the first one is a string and the second is a single number written in an alternate notation. |
03-26-2022, 07:34 AM | #14 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Is it EEL specific?
|
03-26-2022, 07:38 AM | #15 | ||
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
Quote:
Quote:
I’ve edited the code above. Hope it helps. It could of course be changed to work with the other colorspaces by adjusting the calculations for value, but I haven’t looked into that.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika Last edited by ashcat_lt; 03-26-2022 at 07:43 AM. |
||
03-26-2022, 09:08 AM | #16 | |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
Quote:
|
|
03-26-2022, 09:56 AM | #17 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
This is very cool! As someone who ran a BBS for the decade of the 90's I love ASCII art.
I tried this on a video but it was showing no motion. Just a full screen of one character repeated over the screen. When I change text size it zooms in and out. Mode toggles the background color. And contrast changes what ascii character is being used. But no matter which ascii character it's using... it's a full screen of that one character with no movement with the video. Here are the video settings... Length: 7:00.086 Video: 1920x1080@29.97fps, Aspect=1.00, Decoding format=RGB Audio: 48000Hz 2ch 32bps Using VLC decoder (v3.0.x) Video: 1920x1080, h264, 29.97fps Audio: 48000hz, 32bps, 2ch, mp4a Loaded from: C:\Program Files\VideoLAN\VLC |
03-26-2022, 10:32 AM | #18 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
I’m sorry you’re having trouble. Not sure how much help I can be in debugging. You did grab it after my reply at 9:38am CT? Every time I tested this, the video source was on the track below where I put the plugin, never on the actual track with it. You might try that. Whether you put it above or below depends on your Project Settings. I always prefer lower numbered tracks to replace higher, but default is opposite. I’m not in a place I can mess with this atm. Let me know if it actually helps and I’ll look later at how to fix it.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
03-26-2022, 10:37 AM | #19 |
Human being with feelings
Join Date: Dec 2020
Posts: 214
|
|
03-26-2022, 10:45 AM | #20 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
Oh good! It should be an easy fix, when I get the chance. Thanks a bunch.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
03-26-2022, 12:21 PM | #21 | |
Human being with feelings
Join Date: Sep 2008
Location: Sweden
Posts: 7,416
|
This is SO! cool. Nice! Thanks a lot for this video preset.
I had to change ‘RGBA’ on line 7 to "RGBA" for it to compile correctly, Reaper v6.52, Win. SO COOL! Thanks EDIT: I would want to experiment with different #maps. So I did set Code:
map_length = strlen(#map); Code:
map_length = strlen(#map) - 3; OK, I read now the OP: Quote:
__________________
// MVHMF I never always did the right thing, but all I did wasn't wrong... Last edited by Fabian; 03-26-2022 at 12:33 PM. |
|
03-26-2022, 01:13 PM | #22 | ||
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
Quote:
Quote:
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
||
03-26-2022, 02:08 PM | #23 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
edit 2022-03-27: Your version does work very well... track number confusion ... mea culpa.
Last edited by papagirafe; 03-27-2022 at 12:30 PM. Reason: new info |
03-29-2022, 04:40 AM | #24 |
Human being with feelings
Join Date: Dec 2012
Posts: 13,333
|
Cool, really amazing. Would it be possible to make it work only on a part the screen? For example to censor something instead of pixelation. Here is the pixelation code (not sure whether it is bundled with Reaper).
PHP Code:
|
03-29-2022, 05:57 AM | #25 |
Human being with feelings
Join Date: Aug 2020
Location: Brasil
Posts: 679
|
Suggestion:
bottom track: put your video item there track above: insert ashscii preset followed an image overlay preset that includes cropping. tried it, it works update: I forgot to quote vitalker's question in my response. Last edited by papagirafe; 04-02-2022 at 10:15 AM. Reason: omission |
03-29-2022, 08:13 AM | #26 |
Human being with feelings
Join Date: Dec 2012
Posts: 7,271
|
I thought I fixed that track thing.
__________________
Lorenzo's Tractor is Everywhere --- Ash's Tube --- Join the Partnership for a Drum Free Amerika |
04-01-2022, 10:28 PM | #27 |
Human being with feelings
Join Date: May 2008
Location: Nottingham
Posts: 200
|
Used ashSCII on 3 videos from my new album that came out yesterday
https://youtu.be/-sbDv1tU88w https://youtu.be/zdsapRYW1XY https://youtu.be/IGwp0V3NxRw |
05-22-2022, 11:35 AM | #28 |
Human being with feelings
Join Date: Sep 2008
Location: Sweden
Posts: 7,416
|
I modded ashSCII to allow changing the maps:
Code:
// ashSCII MF-mod //@param1:rez 'text size' 5 1 10 5 0.01 //@param2:mode 'mode' 0 0 1 0 1 //@param3:contrast 'contrast' 1 0 4 2.5 0.1 //@param4:map "map" 0 0 3 1.5 1 colorspace = 'RGBA'; #map3 = " _.,-=+:;cba!?0123456789$W#@Ñ"; #map0 = " gloglOgLOGLOgLOglOgloglOgLoGLOGLOGLOGLoGloglo"; #map1 = " $@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,'. "; #map2 = " goddessgoddeSSgoddESSgodDESSgoDDESSgODDESSGODDESSGODDESSGODES"; maps[0] = #map0; maps[1] = #map1; maps[2] = #map2; maps[3] = #map3; #map = maps[map]; map_pad = 2; map_length = strlen(#map) - map_pad; // 66; third = 1/3; _8bit = 1/256; value_mult = map_length * _8bit; down_h = 0.005 * rez * project_h; font="Ariel"; gfx_setfont(down_h,font); #text = "@"; gfx_str_measure(#text,txtw,txth); gfx_setfont(down_h,txth); txt_x_pad = 0; txt_y_pad = 0; txt_x = (txtw + txt_x_pad); txt_y = (txth + txt_y_pad); d_x = floor(project_w / txt_x); d_y = floor(project_h / txt_y); temp = gfx_img_resize (temp,d_x,d_y); gfx_dest = temp; gfx_blit (input_track(0), 0, 0, 0, d_x, d_y); gfx_dest = -1; gfx_set (mode); gfx_fillrect (0,0,project_w,project_h); gfx_set(1-mode); i = 0; while (i < d_x) (j = 0; while (j < d_y) (gfx_getpixel(temp, i, j, r, g, b); value = floor (value_mult * ((0.3 * r + 0.59 * g + 0.11 * b - 127.5) * contrast + 127.5)); mode == 0 ? value = map_length - value; value = max(0, min (map_length, value)); value += map_pad; #text = ""; strcpy_substr(#text,#map,value,1); gfx_str_draw (#text, i*txt_x, j*txt_y); j += 1; ); i += 1; );
__________________
// MVHMF I never always did the right thing, but all I did wasn't wrong... |
Thread Tools | |
Display Modes | |
|
|