• Remix
  • Share
  • New Entry

on 18 Oct 2021
  • 9
  • 147
  • 2
  • 0
  • 280
% If you are looking for a sneaky JPEG-to-MiniHack one to remix, this is the one :)
n=@(x)read(py.os.popen(x)); % interface to running linux command
l="https://i.imgur.com/ADtYwBi.jpeg"; % The url of a JPEG you want to display
n(join(['wget ',l,' -O b'])); % execute command
g=uint8(str2num(char(n('djpeg b | od -An -w1 -tu1 -v')))); % convert to vector of integers
% disp(n('djpeg b | head -n2 | tail -n1')); % Uncomment to display the
% resolution for the image
%m=368; % the resolution for this image
%n=355;
% Now, convert to RGB image. You may need to adjust the "15".
% It is a character offset, based on the digits of the resolution numers.
% 15 is for a 3x3 (i.e., "800 by 600" -- 6 characters in resolution
% 17 is for a 4x4 (i.e. "1920 by 1024" -- 8 characters in resolution
% and so on
for m=1:3
q(:,:,m)=reshape(g(15+m:3:end),368,355)';
end
imshow(q)
text(0,1,"Bottom Text",'fontsize',20)
disp({ones(1,4)*0/0,"Matlab Man!"})
{[NaN NaN NaN NaN]} {["Matlab Man!"]}
% This may be against the spirit of the challenge though. Until then,
% however, hack on :)
Remix Tree