-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jp2a with half carriage feed? #14
Comments
Half carriage has to be supported by the terminal, as far as I can tell most terminal emulators do not support it.
The second image appears 0.6em below the first, where 0.6em is half the line-height. |
Thanks so much! It looks like your (genius) script doubles the ASCII image with overlap. I don't think it renders the optimal overlapped image, but I could be wrong. Rendering two separate ASCII files may be tricky. Normal jp2a can analyze chunks of the image since they are all independent. If characters overlap, other parts of time output are affected. The output optimization becomes trickier. Put a half horizontal space in one output file and then every output character affects the overall rendering. I think some typewriters had that level of horizontal spacing control back in the day. Thanks again! Rabbit demos with your script: |
Worked some awful Matlab code to run simple random optimization of the ASCII overlap image. It does not shift the odd rows half a column but I may add that too. Warning, this code is turrible. ;-) close all C=59+randi(31,6,6) %char(32:1:126) C=zeros(ny,nx)+32 h=imread('rabbit.jpg'); for k=1:3000 %close all subplot(2,1,1);subplot(1,1,1) axis off dy=.063; % This value depends on figure size, WTF? % t=text(x,y,sprintf('ABCDE\n'),'FontName','Arial','FontSize',fs) %char(32:1:126) %char(C) % Replace every \ (92) and _ (95) with space (32) for i=1:ny %pos=get(f,'Position') %print -dbmp fig.bmp spy(gg<150) b=gg(1:xs,1:ys); %whos a b; subplot(2,2,1) norm(a-b); if val<best end end %END BIG LOOP %disp(char(BESTC)) str=' ' save BESTC BESTC |
Assuming you have a half-space along with a half-line feed gives a slightly better rendering IMHO. close all %nx=3 % For testing C=64+randi(26,6,6) C=59+randi(31,6,6) %char(32:1:126) C=zeros(ny,nx)+32 h=imread('rabbit.jpg'); for k=1:4000 %close all subplot(2,1,1);subplot(1,1,1) axis off dy=.063; % This value depends on figure size, WTF? % t=text(x,y,sprintf('ABCDE\n'),'FontName','Arial','FontSize',fs) %char(32:1:126) %char(C) % Replace every \ (92) and _ (95) with space (32) for i=1:ny end %pos=get(f,'Position') %print -dbmp fig.bmp spy(gg<150) b=gg(1:xs,1:ys); %whos a b; subplot(2,2,1) norm(a-b); if val<best end end %END BIG LOOP %disp(char(BESTC)) str=' ' save BESTC BESTC |
I had a bit of nostalgia recently and started a quest to find pre-ascii typewriter art using half carriage feeds to partially overlap lines.
I did find some folks do overstrike art, re-running the full line with text overstrikes.
I have not yet dug into your jp2a utility, but I wonder if you think this could be a possible (easy) modification or option? I am not super familiar with the area so this may already exist. Overstrike, half returns, etc.
A half return would complicate things because we can't display easily so you have to have a display app or write the resulting output to PDF maybe?
I am a MATLAB junkie, so I copied in an example of what I am talking about. I tested it in octave online as well and it seems to render for me with a half step. https://octave-online.net/
Thanks for your utility!
Ed Gatzke
BTW, I tried to email [email protected] and it bounced. ???
subplot(2,1,1);subplot(1,1,1)
f=figure(1)
axis off
axis([0 1 0 1])
fs=14
% Draw some text:
t=text(.1,.7,'This is a test','FontName','Arial','FontSize',fs)
% Draw some two-line text:
t=text(.1,.5,sprintf('This is a test \nThis is a test'),'FontName','Arial','FontSize',fs)
% Overlap two lines, need sprintf as it affects text placemnt
t=text(.27,.5,sprintf('This is a test \n '),'FontName','Arial','FontSize',fs)
dy=.063 % This value depends on figure size, WTF?
t=text(.27,.5-dy,sprintf('This is a test \n '),'FontName','Arial','FontSize',fs)
t=text(.1,.2,sprintf('This is a test \n '),'FontName','Arial','FontSize',fs)
t=text(.1,.2-dy/2,sprintf('This is a test \n '),'FontName','Arial','FontSize',fs)
t=text(.1,.2-dy,sprintf('This is a test \n '),'FontName','Arial','FontSize',fs)
The text was updated successfully, but these errors were encountered: