[Question]
  [
Given an input of an ASCII art picture, output the ASCII art italicized.
To italicize the ASCII art:
1. Insert zero spaces before the last line, one space before the second-last
line, two spaces before the third-last line, etc.
2. Remove any extra leading whitespace that may have been created. That is, if
each line has at least `n` spaces preceding it, remove `n` spaces from the
beginning of each line.
3. Replace all `\`s with `|`, all `|`s with `/`, and all `/`s with `_`. Keep
existing `_`s the same.
The input is guaranteed to contain only the characters `\|/_` and space.
For example, the input
```
/\/\/\    /\/\/\      /\/\/\    /\/\/\
 /\    /\  /\    /\  /\        /\
  /\/\/\    /\/\/\    /\        /\  /\/\
   /\        /\        /\        /\    /\
    /\        /\          /\/\/\    /\/\/\
```
must output
```
_|_|_|    _|_|_|      _|_|_|    _|_|_|
_|    _|  _|    _|  _|        _|
_|_|_|    _|_|_|    _|        _|  _|_|
_|        _|        _|        _|    _|
_|        _|          _|_|_|    _|_|_|
```
which in turn, provided as input, outputs
```
    _/_/_/    _/_/_/      _/_/_/    _/_/_/
   _/    _/  _/    _/  _/        _/
  _/_/_/    _/_/_/    _/        _/  _/_/
 _/        _/        _/        _/    _/
_/        _/          _/_/_/    _/_/_/
```
which would output
```
        ______    ______      ______    ______
      __    __  __    __  __        __
    ______    ______    __        __  ____
  __        __        __        __    __
__        __          ______    ______
```
Input and output may be either a single string (with optional trailing newline)
or an array of lines.
Since this is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), the shortest code in bytes will win.
Extra test cases:
```
|||||
  /////
 \\\\\
   _____
```
```
 /////
  _____
|||||
 _____
```
  
```
________
```
```
________
```
  
(that is, input of empty string results in output of empty string)
  
[Answer]
## CJam, ~~43~~ 38 bytes
```
qN/W%eeSf.*:sW%z_{S-}#>zN*"\|/__"_(+er
```
Requires the input to be padded to a rectangle.
[Try it online!](http://cjam.tryitonline.net/#code=cU4vVyVlZVNmLio6c1clel97Uy19Iz56TioiXHwvX18iXygrZXI&input=L1wvXC9cICAgIC9cL1wvXCAgICAgIC9cL1wvXCAgICAvXC9cL1wgICAgCiAvXCAgICAvXCAgL1wgICAgL1wgIC9cICAgICAgICAvXCAgICAgICAgIAogIC9cL1wvXCAgICAvXC9cL1wgICAgL1wgICAgICAgIC9cICAvXC9cICAKICAgL1wgICAgICAgIC9cICAgICAgICAvXCAgICAgICAgL1wgICAgL1wgCiAgICAvXCAgICAgICAgL1wgICAgICAgICAgL1wvXC9cICAgIC9cL1wvXA)
### Explanation
```
qN/     e# Read input, split into lines.
W%      e# Reverse lines.
ee      e# Enumerate them (pairing each line with its index starting from 0).
Sf.*    e# Turn each index i into i spaces.
:s      e# Flatten each pair into a single string, prepending the spaces.
W%      e# Reverse the lines again.
z_      e# Transpose the character grid, duplicate it.
{S-}#   e# Find the first row index that contains non-spaces.
>       e# Discard that many rows.
zN*     e# Transpose back and join with linefeeds.
"\|/__" e# Push this string.
_(+     e# Make a copy that's rotated one character to the left, i.e. "|/__\".
er      e# Perform character transliteration mapping from the first string to the second.
```
[Answer]
# Pyth, 32
```
jCf|Z=Z-Td.t_.e+*kd.rb"\|/__"_Qd
```
[Try it here](http://pyth.herokuapp.com/?code=jCf%7CZ%3DZ-Td.t_.e%2B%2akd.rb%22%5C%7C%2F__%22_.zd&input=%5B%27%7C%7C%7C%7C%7C%27%2C+%27++%2F%2F%2F%2F%2F%27%2C+%27+%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%27%2C+%27+++_____%27%5D&debug=0) or run the [Test Suite](http://pyth.herokuapp.com/?code=jCf%7CZ%3DZ-Td.t_.e%2B%2akd.rb%22%5C%7C%2F__%22_Qd&input=%7C%7C%7C%7C%7C%0A++%2F%2F%2F%2F%2F%0A+%5C%5C%5C%5C%5C%0A+++_____&test_suite=1&test_suite_input=%5B%27______%27%5D%0A%5B%27%27%5D%0A%5B%27%2F%5C%5C%2F%5C%5C%2F%5C%5C++++%2F%5C%5C%2F%5C%5C%2F%5C%5C++++++%2F%5C%5C%2F%5C%5C%2F%5C%5C++++%2F%5C%5C%2F%5C%5C%2F%5C%5C%27%2C+%27+%2F%5C%5C++++%2F%5C%5C++%2F%5C%5C++++%2F%5C%5C++%2F%5C%5C++++++++%2F%5C%5C%27%2C+%27++%2F%5C%5C%2F%5C%5C%2F%5C%5C++++%2F%5C%5C%2F%5C%5C%2F%5C%5C++++%2F%5C%5C++++++++%2F%5C%5C++%2F%5C%5C%2F%5C%5C%27%2C+%27+++%2F%5C%5C++++++++%2F%5C%5C++++++++%2F%5C%5C++++++++%2F%5C%5C++++%2F%5C%5C%27%2C+%27++++%2F%5C%5C++++++++%2F%5C%5C++++++++++%2F%5C%5C%2F%5C%5C%2F%5C%5C++++%2F%5C%5C%2F%5C%5C%2F%5C%5C%27%5D%0A%5B%27_%7C_%7C_%7C++++_%7C_%7C_%7C++++++_%7C_%7C_%7C++++_%7C_%7C_%7C%27%2C+%27_%7C++++_%7C++_%7C++++_%7C++_%7C++++++++_%7C%27%2C+%27_%7C_%7C_%7C++++_%7C_%7C_%7C++++_%7C++++++++_%7C++_%7C_%7C%27%2C+%27_%7C++++++++_%7C++++++++_%7C++++++++_%7C++++_%7C%27%2C+%27_%7C++++++++_%7C++++++++++_%7C_%7C_%7C++++_%7C_%7C_%7C%27%5D%0A%5B%27++++_%2F_%2F_%2F++++_%2F_%2F_%2F++++++_%2F_%2F_%2F++++_%2F_%2F_%2F%27%2C+%27+++_%2F++++_%2F++_%2F++++_%2F++_%2F++++++++_%2F%27%2C+%27++_%2F_%2F_%2F++++_%2F_%2F_%2F++++_%2F++++++++_%2F++_%2F_%2F%27%2C+%27+_%2F++++++++_%2F++++++++_%2F++++++++_%2F++++_%2F%27%2C+%27_%2F++++++++_%2F++++++++++_%2F_%2F_%2F++++_%2F_%2F_%2F%27%5D&debug=0)
Each line has several trailing spaces. This works by applying `.r` which is the rotation built-in to each line of the string. The rotation takes each character in the string that matches one in the other argument `"\|/__"` and replaces it with the next character. The double underscore nicely prevents underscores from becoming backslashes. The strings are also padded based on their index.
Once that is done, the lines are zipped together, then we filter out each column that only contains spaces, until one of them doesn't. Then we unzip and join on newlines.
[Answer]
# [MATL](https://esolangs.org/wiki/MATL), ~~38~~ ~~33~~ 29 bytes
```
P"NZ"@Y:'\|/' '|/_'XEh]XhPcYv
```
Output lines have trailing spaces to match the longest line (this is allowed by the challenge).
Input is a cell array (list) of strings. The array uses curly braces, and strings use single quotes, as follows (click each link to *Try it online!*).
* [First example](http://matl.tryitonline.net/#code=UCJOWiJAWTonXHwvJyAnfC9fJ1hFaF1YaFBjWXY&input=eycvXC9cL1wgICAgL1wvXC9cICAgICAgL1wvXC9cICAgIC9cL1wvXCcgICcgL1wgICAgL1wgIC9cICAgIC9cICAvXCAgICAgICAgL1wnICAnICAvXC9cL1wgICAgL1wvXC9cICAgIC9cICAgICAgICAvXCAgL1wvXCcgJyAgIC9cICAgICAgICAvXCAgICAgICAgL1wgICAgICAgIC9cICAgIC9cJyAnICAgIC9cICAgICAgICAvXCAgICAgICAgICAvXC9cL1wgICAgL1wvXC9cJ30K):
```
{'/\/\/\    /\/\/\      /\/\/\    /\/\/\'  ' /\    /\  /\    /\  /\        /\'  '  /\/\/\    /\/\/\    /\        /\  /\/\' '   /\        /\        /\        /\    /\' '    /\        /\          /\/\/\    /\/\/\'}
```
* [Second example](http://matl.tryitonline.net/#code=UCJOWiJAWTonXHwvJyAnfC9fJ1hFaF1YaFBjWXY&input=eydffF98X3wgICAgX3xffF98ICAgICAgX3xffF98ICAgIF98X3xffCcgJ198ICAgIF98ICBffCAgICBffCAgX3wgICAgICAgIF98ICAgICAgJyAnX3xffF98ICAgIF98X3xffCAgICBffCAgICAgICAgX3wgIF98X3wnICdffCAgICAgICAgX3wgICAgICAgIF98ICAgICAgICBffCAgICBffCcgJ198ICAgICAgICBffCAgICAgICAgICBffF98X3wgICAgX3xffF98J30K):
```
{'_|_|_|    _|_|_|      _|_|_|    _|_|_|' '_|    _|  _|    _|  _|        _|      ' '_|_|_|    _|_|_|    _|        _|  _|_|' '_|        _|        _|        _|    _|' '_|        _|          _|_|_|    _|_|_|'}
```
* [Third example](http://matl.tryitonline.net/#code=UCJOWiJAWTonXHwvJyAnfC9fJ1hFaF1YaFBjWXY&input=eycgICAgXy9fL18vICAgIF8vXy9fLyAgICAgIF8vXy9fLyAgICBfL18vXy8nICcgICBfLyAgICBfLyAgXy8gICAgXy8gIF8vICAgICAgICBfLyAgICAgICAnICcgIF8vXy9fLyAgICBfL18vXy8gICAgXy8gICAgICAgIF8vICBfL18vICAnICcgXy8gICAgICAgIF8vICAgICAgICBfLyAgICAgICAgXy8gICAgXy8gICAnICdfLyAgICAgICAgXy8gICAgICAgICAgXy9fL18vICAgIF8vXy9fLyAgICAnfQo):
```
{'    _/_/_/    _/_/_/      _/_/_/    _/_/_/' '   _/    _/  _/    _/  _/        _/       ' '  _/_/_/    _/_/_/    _/        _/  _/_/  ' ' _/        _/        _/        _/    _/   ' '_/        _/          _/_/_/    _/_/_/    '}
```
### Explanation
The array is initially flipped. Each string is processed in a loop and the modified string is pushed onto the stack. Processing consists in replacing the characters and appending a number of spaces. The number of spaces equals the current number of elements in the stack (thanks to the fact that the array has been flipped).
After the loop the strings are collected in an array, which is flipped back, converted to a 2D char array, and disposed of unwanted leading spaces: leading spaces that are present in all rows of the 2D char array.
```
P             % implicitly input cell array of strings. Flip it (reverse order)
"             % for each
  NZ"         %   string with as many spaces as elements there are on the stack
  @Y:         %   push current input string
  '\|/'       %   push string: origin for replacement
  '|/_'       %   push string: target for replacement
  XE          %   replace
  h           %   concatenate string with spaces and modified-character string
]             % end for each
Xh            % collect all processed strings in a cell array
P             % flip back to restore original order
c             % convert to 2D char array
Yv            % remove trailing spaces common to all rows. Implicitly display
```
[Answer]
## JavaScript (ES6), ~~171~~ ~~149~~ 148 bytes
```
a=>a.map(s=>(t=' '.repeat(--i)+s,l=t.match` *`[0].length,n=l<n?l:n,t),n=i=a.length).map(s=>s.slice(n).replace(/./g,c=>"|/__ "["\\|/_ ".indexOf(c)]))
```
Accepts and returns lines as an array of strings.
Edit: Saved 22 bytes thanks to @user81655. Saved 1 byte by realising that the input is limited to the 5 characters `\|/_` and space.
[Answer]
# [Dyalog APL](http://goo.gl/9KrKoM) (older versions), ~~23~~ 48 bytes
Adjusting whitespace is expensive:
```
{{⍵↓⍨0,⌊/+/∧\' '=⍵}(⍳≢⍵)⌽'|/ _'['\| '⍳(∊,⊢,∊)⍵]}
```
This requires `⎕ML←0`, which [was default until recently](http://help.dyalog.com/14.0/Content/Language/System%20Functions/ml.htm).
[Answer]
# [Vyxal](https://github.com/Lyxal/Vyxal), `a` ~~39~~ 37 bytes
-2 thanks to @Aaron Miller
```
ṘėṘƛt`\|/``|/_`Ŀnh$꘍;:ƛ`^ *`$et;g£ƛ¥ȯ
```
Really bad answer, id like to fix it;
the program takes in the string, breaks it into chunks, transliterates to the correct characters, and then spends most of the chars trying to fix the spacing.
[Try it Online!](http://lyxal.pythonanywhere.com?flags=a&code=%E1%B9%98%C4%97%E1%B9%98%C6%9Bt%60%5C%7C%2F%60%60%7C%2F_%60%C4%BFnh%24%EA%98%8D%3B%3A%C6%9B%60%5E%20*%60%24et%3Bg%C2%A3%C6%9B%C2%A5%C8%AF&inputs=%20%2F%5C%2F%5C%2F%5C%20%20%20%20%2F%5C%2F%5C%2F%5C%0A%2F%5C%20%20%20%20%20%20%20%20%2F%5C%0A%20%2F%5C%20%20%20%20%20%20%20%20%2F%5C%20%20%2F%5C%2F%5C%0A%20%20%2F%5C%20%20%20%20%20%20%20%20%2F%5C%20%20%20%20%2F%5C%0A%20%20%20%20%20%2F%5C%2F%5C%2F%5C%20%20%20%20%2F%5C%2F%5C%2F%5C&header=&footer=%2C)
[Answer]
# [Pip](https://github.com/dloscutoff/pip) `-rl`, ~~39~~ ~~38~~ ~~37~~ 36 bytes
*How do you golf an elephant? One byte at a time...*
```
YsXRV,#g.:gWw~=@ZyY@>*yyTR"\|/""|/_"
```
[Try it online!](https://tio.run/##K8gs@P8/sjgiKExHOV3PKj28vM7WIaoy0sFOq7IyJEgppkZfSalGP17p/3/9GBBUAAIEC5mNYHEpwEQUMFgwHhRwYTcBVS1ElEsBuxnoLCDJhUsFpm3/dYtyAA "Pip – Try It Online")
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 32 bytes
```
JU⁶ẋ$;¥"µEƤS$€Ṃ$‘ṫ€@µ“\|/“|/_”yⱮ
```
[Try it online!](https://tio.run/##y0rNyan8/98r9FHjtoe7ulWsDy1VOrTV9diSYJVHTWse7mxSedQw4@HO1UCOw6GtjxrmxNToA8ka/fhHDXMrH21c9//h7i2H2yMf7mw5tPXY5EMLH@6cDZQHSv43/q8fA4IKQIBgIbMhLC4FGE8BgwXhcWFqgimDKYGIc2GIYmdBVGJVgGkVAA "Jelly – Try It Online")
The number in STDIN just indicates how many times italicization will be run (for easier testing). Set it to 1 for normal execution.
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 24 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
╦'Fi╘◘¥╘τ9jq'∟w7#ù╢→↨↨─╟
```
[Run and debug it](https://staxlang.xyz/#p=cb274669d4089dd4e7396a71271c77372397b61a1717c4c7&i=%5B%5B47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92%5D,+%5B32,+47,+92,+32,+32,+32,+32,+47,+92,+32,+32,+47,+92,+32,+32,+32,+32,+47,+92,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92%5D,+%5B32,+32,+47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+32,+32,+47,+92,+47,+92%5D,+%5B32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+47,+92%5D,+%5B32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+32,+32,+32,+32,+32,+32,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92,+32,+32,+32,+32,+47,+92,+47,+92,+47,+92%5D%5D%0A%5B%5B95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124%5D,+%5B95,+124,+32,+32,+32,+32,+95,+124,+32,+32,+95,+124,+32,+32,+32,+32,+95,+124,+32,+32,+95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124%5D,+%5B95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+32,+32,+95,+124,+95,+124%5D,+%5B95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+32,+32,+32,+32,+95,+124%5D,+%5B95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+32,+32,+32,+32,+32,+32,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124,+32,+32,+32,+32,+95,+124,+95,+124,+95,+124%5D%5D%0A%5B%5B32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47%5D,+%5B32,+32,+32,+95,+47,+32,+32,+32,+32,+95,+47,+32,+32,+95,+47,+32,+32,+32,+32,+95,+47,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32%5D,+%5B32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+95,+47,+95,+47,+32,+32%5D,+%5B32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+95,+47,+32,+32,+32%5D,+%5B95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+32,+32,+32,+32,+32,+32,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32,+95,+47,+95,+47,+95,+47,+32,+32,+32,+32%5D%5D%0A%5B%5B124,+124,+124,+124,+124%5D,+%5B32,+32,+47,+47,+47,+47,+47%5D,+%5B32,+92,+92,+92,+92,+92%5D,+%5B32,+32,+32,+95,+95,+95,+95,+95%5D%5D%0A%5B%22________%22%5D%0A%5B%22%22%5D&m=2)
Takes a list of lines as input. They are formatted as ascii codepoints for convenience, but you can still pass a list of strings directly.
[Answer]
# [Python 3.8 (pre-release)](https://docs.python.org/3.8/), 84 bytes
```
def f(s):
 i=len(s)
 for x in s:print(' '*i+x.translate({92:124,124:47,47:95}));i-=1
```
[Try it online!](https://tio.run/##K6gsycjPM7YoKPqfYxutHl8DggpAgGAhsyEsdR11GBeCkVkQHlgJplnISiDicLMwpZFZOBVicV3s/5TUNIU0jWJNKy6FTNuc1Dwgk0shLb9IoUIhM0@h2KqgKDOvRENdQV0rU7tCr6QoMa84J7EkVaPa0sjK0MhEB4itTMx1TMytLE1rNTWtM3VtDf@naeRo/gcA "Python 3.8 (pre-release) – Try It Online")
]