R,302字节
远非完美,但这里有:
a<-as.raster(imager::load.image(file.choose()));l=letters;n=as.numeric;d=a;f=function(x){if(suppressWarnings(is.na(n(x)))){if(x=="F")"0" else{l[match(x,toupper(l))+1]}}else{if(x==9)"A" else as.character(n(x)+1)}};for(o in 1:90){for(g in 1:200){for(h in 2:7){substr(d[o,g],h,h)<-f(substr(a[o,g],h,h))}}}
说明:
a<-as.raster(imager::load.image(file.choose())); //chooses file
l=letters;n=as.numeric;d=a; //shortens some names and creates
duplicate variable to modify
f=function(x){ //creates a function that takes in a
if(suppressWarnings(is.na(n(x)))){ character type and checks whether it is
if(x=="F")"0" a number or letter.
else{l[match(x,toupper(l))+1]}} Returns the converted letter or number.
else{
if(x==9)"A"
else as.character(n(x)+1)}
};
for(o in 1:90){ //loops through every single hex digit and applies
for(g in 1:200){ the converting function, modifying the duplicate
for(h in 2:7){ variable. Now you have 2 images =D
substr(d[o,g],h,h)<-f(substr(a[o,g],h,h))
}
}
}