Make a transparent 448*448 image
$begingroup$
This is a simple challenge.
The task is to write code that outputs a 448*448 square image with 100% transparency. The output should follow the standard image rules.
code-golf graphical-output
$endgroup$
add a comment |
$begingroup$
This is a simple challenge.
The task is to write code that outputs a 448*448 square image with 100% transparency. The output should follow the standard image rules.
code-golf graphical-output
$endgroup$
4
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago
add a comment |
$begingroup$
This is a simple challenge.
The task is to write code that outputs a 448*448 square image with 100% transparency. The output should follow the standard image rules.
code-golf graphical-output
$endgroup$
This is a simple challenge.
The task is to write code that outputs a 448*448 square image with 100% transparency. The output should follow the standard image rules.
code-golf graphical-output
code-golf graphical-output
asked 9 hours ago
AnushAnush
777425
777425
4
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago
add a comment |
4
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago
4
4
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago
add a comment |
16 Answers
16
active
oldest
votes
$begingroup$
APL (Dyalog Unicode), 11 bytesSBCS
Full program. Prints 448-by-448-by-4 array representing a 448-by-448 rgba image.
448 448 4⍴0
Try it online!
⍴
is reshape
$endgroup$
add a comment |
$begingroup$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
$endgroup$
add a comment |
$begingroup$
Imagemagick in some shell, 35
convert -size 448x448 xc:none a.png
Is this allowed?
$endgroup$
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
add a comment |
$begingroup$
Python 2.7, 17 Bytes (22 With Print)
[[[0]*4]*488]*488
With Print:
print[[[0]*4]*488]*488
As variable:
x=[[[0]*4]*488]*488
As an array of RGBA is allowed, that is what I have created above, defaulting to all 0's - meaning black, but totally transparent.
Try it online!
$endgroup$
add a comment |
$begingroup$
Jelly, 8 bytes
448ṁ4¬¥þ
A niladic Link which yields a 448 by 448 RGBA array of transparent black pixels.
Try it online!
How?
448ṁ4¬¥þ - Link: no arguments
448 - 448
þ - outer-product with: -- i.e. [[f(x,y) for y in [1..448]] for x in [1..448]]
¥ - last two links as a dyad:
ṁ4 - mould like [1,2,3,4] -- e.g. x=7 -> [7,7,7,7]
¬ - logical NOT -> [0,0,0,0]
$endgroup$
add a comment |
$begingroup$
Jelly, 10 9 bytes
x4Wẋ448Ɗ⁺
Try it online!
Outputs a 448x448x4 array
Thanks to @JonathanAllan for saving a byte.
$endgroup$
1
$begingroup$
2¡
can be⁺
$endgroup$
– Jonathan Allan
7 hours ago
add a comment |
$begingroup$
Go, 70
import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))}
Never seen a golf in Go before. Defines a function called a that outputs the image
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 48 bytes
_=>(Enumerable.Repeat((0,0,0,0),200704),448,448)
Apparently outputting [1D array of pixels, width, height]
is ok, so this outputs a tuple of `(IEnumerable of pixels, width, height).
Try it online!
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
The original matrix returning answer.
Since the image IO rules allow output as a matrix of RGB values, this submission outputs a matrix of RGBA values, represented by tuples with four values, all being 0.
Try it online!
$endgroup$
add a comment |
$begingroup$
dzaima/APL + APLP5, 18 bytes
{P5.img 448 448⍴0}
Function that outputs an image object that can be drawn to the screen (for no effect) or converted back to pixel values.
$endgroup$
add a comment |
$begingroup$
Java 8
Saving the image to a file with path s
, 101 bytes
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
Returning the BufferedImage, 47 bytes
()->new java.awt.image.BufferedImage(448,448,2)
Saving the image to the file f
, 83 bytes
f->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",f)
Dumping PNG to STDOUT, 93 bytes (thanks ASCII-only!)
()->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",System.out)
Try it online!
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
|
show 2 more comments
$begingroup$
JavaScript (Node.js), 42 bytes
_=>[Array(200704).fill([0,0,0,0]),448,448]
Apparently outputting [1D array of pixels, width, height]
is ok.
Try it online!
$endgroup$
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
add a comment |
$begingroup$
HTML, 25 bytes
Is this valid?
<svg height=448 width=448
Test it (background
applied with CSS so you can "see" it)
$endgroup$
add a comment |
$begingroup$
JavaScript (ES6), 74 69 bytes
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
Returns a PNG image encoded as a data: URL suitable e.g. for setting as the src
of an HTMLImageElement
. Edit: Saved 3 bytes thanks to @Shaggy and a further 2 bytes thanks to @Arnauld.
$endgroup$
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.
$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
add a comment |
$begingroup$
SmileBASIC, 27 bytes
DIM A[448,448]SAVE"DAT:I",A
Saves a 2-dimensional 448x448 array filled with 0s to a file named DAT:I
$endgroup$
add a comment |
$begingroup$
Rust - 206 201 bytes
use std::{fs::File,io::Write};fn main(){File::create("o.tga").unwrap().write(&vec![0,0,2,0,0,0,0,0,0,0,0,0,192,1,192,1,32,0].iter().chain(vec![0u8;802816].iter()).map(|n|*n).collect::<Vec<u8>>());}
This write an actual, readable .tga file, per http://paulbourke.net/dataformats/tga/ by hard coding the width,height, into the binary file header.
-5 bytes shorten filename, fix img size, @ASCII-only
$endgroup$
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well alsoa
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be10
not2
. even better, colormap for shorter run length encoding (0,0,0,0
->0
)
$endgroup$
– ASCII-only
1 hour ago
|
show 4 more comments
$begingroup$
Jstx, 24 bytes
♪☺ü@/øP♦£Q)%)£Q◄úæD)%)£Q
Explanation
♪☺ü@ # Push literal 448
/ # Store the first stack value in the a register.
ø # Push literal 0
P # Push four copies of the first stack value.
♦ # Push literal 4
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
◄úæ # Push literal n
D # Push the sum of the second and first stack values.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
Try it online!
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
});
});
}, "mathjax-editing");
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "200"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f181409%2fmake-a-transparent-448448-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
16 Answers
16
active
oldest
votes
16 Answers
16
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
APL (Dyalog Unicode), 11 bytesSBCS
Full program. Prints 448-by-448-by-4 array representing a 448-by-448 rgba image.
448 448 4⍴0
Try it online!
⍴
is reshape
$endgroup$
add a comment |
$begingroup$
APL (Dyalog Unicode), 11 bytesSBCS
Full program. Prints 448-by-448-by-4 array representing a 448-by-448 rgba image.
448 448 4⍴0
Try it online!
⍴
is reshape
$endgroup$
add a comment |
$begingroup$
APL (Dyalog Unicode), 11 bytesSBCS
Full program. Prints 448-by-448-by-4 array representing a 448-by-448 rgba image.
448 448 4⍴0
Try it online!
⍴
is reshape
$endgroup$
APL (Dyalog Unicode), 11 bytesSBCS
Full program. Prints 448-by-448-by-4 array representing a 448-by-448 rgba image.
448 448 4⍴0
Try it online!
⍴
is reshape
answered 9 hours ago
AdámAdám
28.6k276204
28.6k276204
add a comment |
add a comment |
$begingroup$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
$endgroup$
add a comment |
$begingroup$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
$endgroup$
add a comment |
$begingroup$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
$endgroup$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
answered 9 hours ago
dzaimadzaima
15.3k21856
15.3k21856
add a comment |
add a comment |
$begingroup$
Imagemagick in some shell, 35
convert -size 448x448 xc:none a.png
Is this allowed?
$endgroup$
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
add a comment |
$begingroup$
Imagemagick in some shell, 35
convert -size 448x448 xc:none a.png
Is this allowed?
$endgroup$
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
add a comment |
$begingroup$
Imagemagick in some shell, 35
convert -size 448x448 xc:none a.png
Is this allowed?
$endgroup$
Imagemagick in some shell, 35
convert -size 448x448 xc:none a.png
Is this allowed?
answered 8 hours ago
zeveezevee
28016
28016
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
add a comment |
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
8 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Please specify the shell
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
$begingroup$
Bash, I guess? That's what I used when I tested it. Any POSIX shell should work?
$endgroup$
– zevee
2 hours ago
add a comment |
$begingroup$
Python 2.7, 17 Bytes (22 With Print)
[[[0]*4]*488]*488
With Print:
print[[[0]*4]*488]*488
As variable:
x=[[[0]*4]*488]*488
As an array of RGBA is allowed, that is what I have created above, defaulting to all 0's - meaning black, but totally transparent.
Try it online!
$endgroup$
add a comment |
$begingroup$
Python 2.7, 17 Bytes (22 With Print)
[[[0]*4]*488]*488
With Print:
print[[[0]*4]*488]*488
As variable:
x=[[[0]*4]*488]*488
As an array of RGBA is allowed, that is what I have created above, defaulting to all 0's - meaning black, but totally transparent.
Try it online!
$endgroup$
add a comment |
$begingroup$
Python 2.7, 17 Bytes (22 With Print)
[[[0]*4]*488]*488
With Print:
print[[[0]*4]*488]*488
As variable:
x=[[[0]*4]*488]*488
As an array of RGBA is allowed, that is what I have created above, defaulting to all 0's - meaning black, but totally transparent.
Try it online!
$endgroup$
Python 2.7, 17 Bytes (22 With Print)
[[[0]*4]*488]*488
With Print:
print[[[0]*4]*488]*488
As variable:
x=[[[0]*4]*488]*488
As an array of RGBA is allowed, that is what I have created above, defaulting to all 0's - meaning black, but totally transparent.
Try it online!
answered 7 hours ago
Snaddyvitch DispenserSnaddyvitch Dispenser
615
615
add a comment |
add a comment |
$begingroup$
Jelly, 8 bytes
448ṁ4¬¥þ
A niladic Link which yields a 448 by 448 RGBA array of transparent black pixels.
Try it online!
How?
448ṁ4¬¥þ - Link: no arguments
448 - 448
þ - outer-product with: -- i.e. [[f(x,y) for y in [1..448]] for x in [1..448]]
¥ - last two links as a dyad:
ṁ4 - mould like [1,2,3,4] -- e.g. x=7 -> [7,7,7,7]
¬ - logical NOT -> [0,0,0,0]
$endgroup$
add a comment |
$begingroup$
Jelly, 8 bytes
448ṁ4¬¥þ
A niladic Link which yields a 448 by 448 RGBA array of transparent black pixels.
Try it online!
How?
448ṁ4¬¥þ - Link: no arguments
448 - 448
þ - outer-product with: -- i.e. [[f(x,y) for y in [1..448]] for x in [1..448]]
¥ - last two links as a dyad:
ṁ4 - mould like [1,2,3,4] -- e.g. x=7 -> [7,7,7,7]
¬ - logical NOT -> [0,0,0,0]
$endgroup$
add a comment |
$begingroup$
Jelly, 8 bytes
448ṁ4¬¥þ
A niladic Link which yields a 448 by 448 RGBA array of transparent black pixels.
Try it online!
How?
448ṁ4¬¥þ - Link: no arguments
448 - 448
þ - outer-product with: -- i.e. [[f(x,y) for y in [1..448]] for x in [1..448]]
¥ - last two links as a dyad:
ṁ4 - mould like [1,2,3,4] -- e.g. x=7 -> [7,7,7,7]
¬ - logical NOT -> [0,0,0,0]
$endgroup$
Jelly, 8 bytes
448ṁ4¬¥þ
A niladic Link which yields a 448 by 448 RGBA array of transparent black pixels.
Try it online!
How?
448ṁ4¬¥þ - Link: no arguments
448 - 448
þ - outer-product with: -- i.e. [[f(x,y) for y in [1..448]] for x in [1..448]]
¥ - last two links as a dyad:
ṁ4 - mould like [1,2,3,4] -- e.g. x=7 -> [7,7,7,7]
¬ - logical NOT -> [0,0,0,0]
edited 6 hours ago
answered 6 hours ago
Jonathan AllanJonathan Allan
52.9k535172
52.9k535172
add a comment |
add a comment |
$begingroup$
Jelly, 10 9 bytes
x4Wẋ448Ɗ⁺
Try it online!
Outputs a 448x448x4 array
Thanks to @JonathanAllan for saving a byte.
$endgroup$
1
$begingroup$
2¡
can be⁺
$endgroup$
– Jonathan Allan
7 hours ago
add a comment |
$begingroup$
Jelly, 10 9 bytes
x4Wẋ448Ɗ⁺
Try it online!
Outputs a 448x448x4 array
Thanks to @JonathanAllan for saving a byte.
$endgroup$
1
$begingroup$
2¡
can be⁺
$endgroup$
– Jonathan Allan
7 hours ago
add a comment |
$begingroup$
Jelly, 10 9 bytes
x4Wẋ448Ɗ⁺
Try it online!
Outputs a 448x448x4 array
Thanks to @JonathanAllan for saving a byte.
$endgroup$
Jelly, 10 9 bytes
x4Wẋ448Ɗ⁺
Try it online!
Outputs a 448x448x4 array
Thanks to @JonathanAllan for saving a byte.
edited 6 hours ago
answered 8 hours ago
Nick KennedyNick Kennedy
65137
65137
1
$begingroup$
2¡
can be⁺
$endgroup$
– Jonathan Allan
7 hours ago
add a comment |
1
$begingroup$
2¡
can be⁺
$endgroup$
– Jonathan Allan
7 hours ago
1
1
$begingroup$
2¡
can be ⁺
$endgroup$
– Jonathan Allan
7 hours ago
$begingroup$
2¡
can be ⁺
$endgroup$
– Jonathan Allan
7 hours ago
add a comment |
$begingroup$
Go, 70
import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))}
Never seen a golf in Go before. Defines a function called a that outputs the image
$endgroup$
add a comment |
$begingroup$
Go, 70
import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))}
Never seen a golf in Go before. Defines a function called a that outputs the image
$endgroup$
add a comment |
$begingroup$
Go, 70
import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))}
Never seen a golf in Go before. Defines a function called a that outputs the image
$endgroup$
Go, 70
import i"image";func a()i.Image{return i.NewRGBA(i.Rect(0,0,448,448))}
Never seen a golf in Go before. Defines a function called a that outputs the image
edited 7 hours ago
Embodiment of Ignorance
1,678124
1,678124
answered 8 hours ago
zeveezevee
28016
28016
add a comment |
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 48 bytes
_=>(Enumerable.Repeat((0,0,0,0),200704),448,448)
Apparently outputting [1D array of pixels, width, height]
is ok, so this outputs a tuple of `(IEnumerable of pixels, width, height).
Try it online!
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
The original matrix returning answer.
Since the image IO rules allow output as a matrix of RGB values, this submission outputs a matrix of RGBA values, represented by tuples with four values, all being 0.
Try it online!
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 48 bytes
_=>(Enumerable.Repeat((0,0,0,0),200704),448,448)
Apparently outputting [1D array of pixels, width, height]
is ok, so this outputs a tuple of `(IEnumerable of pixels, width, height).
Try it online!
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
The original matrix returning answer.
Since the image IO rules allow output as a matrix of RGB values, this submission outputs a matrix of RGBA values, represented by tuples with four values, all being 0.
Try it online!
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 48 bytes
_=>(Enumerable.Repeat((0,0,0,0),200704),448,448)
Apparently outputting [1D array of pixels, width, height]
is ok, so this outputs a tuple of `(IEnumerable of pixels, width, height).
Try it online!
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
The original matrix returning answer.
Since the image IO rules allow output as a matrix of RGB values, this submission outputs a matrix of RGBA values, represented by tuples with four values, all being 0.
Try it online!
$endgroup$
C# (Visual C# Interactive Compiler), 48 bytes
_=>(Enumerable.Repeat((0,0,0,0),200704),448,448)
Apparently outputting [1D array of pixels, width, height]
is ok, so this outputs a tuple of `(IEnumerable of pixels, width, height).
Try it online!
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
The original matrix returning answer.
Since the image IO rules allow output as a matrix of RGB values, this submission outputs a matrix of RGBA values, represented by tuples with four values, all being 0.
Try it online!
edited 2 hours ago
answered 8 hours ago
Embodiment of IgnoranceEmbodiment of Ignorance
1,678124
1,678124
add a comment |
add a comment |
$begingroup$
dzaima/APL + APLP5, 18 bytes
{P5.img 448 448⍴0}
Function that outputs an image object that can be drawn to the screen (for no effect) or converted back to pixel values.
$endgroup$
add a comment |
$begingroup$
dzaima/APL + APLP5, 18 bytes
{P5.img 448 448⍴0}
Function that outputs an image object that can be drawn to the screen (for no effect) or converted back to pixel values.
$endgroup$
add a comment |
$begingroup$
dzaima/APL + APLP5, 18 bytes
{P5.img 448 448⍴0}
Function that outputs an image object that can be drawn to the screen (for no effect) or converted back to pixel values.
$endgroup$
dzaima/APL + APLP5, 18 bytes
{P5.img 448 448⍴0}
Function that outputs an image object that can be drawn to the screen (for no effect) or converted back to pixel values.
answered 8 hours ago
dzaimadzaima
15.3k21856
15.3k21856
add a comment |
add a comment |
$begingroup$
Java 8
Saving the image to a file with path s
, 101 bytes
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
Returning the BufferedImage, 47 bytes
()->new java.awt.image.BufferedImage(448,448,2)
Saving the image to the file f
, 83 bytes
f->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",f)
Dumping PNG to STDOUT, 93 bytes (thanks ASCII-only!)
()->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",System.out)
Try it online!
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
|
show 2 more comments
$begingroup$
Java 8
Saving the image to a file with path s
, 101 bytes
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
Returning the BufferedImage, 47 bytes
()->new java.awt.image.BufferedImage(448,448,2)
Saving the image to the file f
, 83 bytes
f->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",f)
Dumping PNG to STDOUT, 93 bytes (thanks ASCII-only!)
()->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",System.out)
Try it online!
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
|
show 2 more comments
$begingroup$
Java 8
Saving the image to a file with path s
, 101 bytes
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
Returning the BufferedImage, 47 bytes
()->new java.awt.image.BufferedImage(448,448,2)
Saving the image to the file f
, 83 bytes
f->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",f)
Dumping PNG to STDOUT, 93 bytes (thanks ASCII-only!)
()->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",System.out)
Try it online!
$endgroup$
Java 8
Saving the image to a file with path s
, 101 bytes
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
Returning the BufferedImage, 47 bytes
()->new java.awt.image.BufferedImage(448,448,2)
Saving the image to the file f
, 83 bytes
f->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",f)
Dumping PNG to STDOUT, 93 bytes (thanks ASCII-only!)
()->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",System.out)
Try it online!
edited 3 hours ago
answered 8 hours ago
Benjamin UrquhartBenjamin Urquhart
715
715
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
|
show 2 more comments
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
1
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
I'm pretty sure empty pngs are transparent, are they not? I typed this up on my phone so I can't check
$endgroup$
– Benjamin Urquhart
8 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
Just write to stdout
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@ASCII-only So, write an empty (filled with zeros) 448*448*4 array to stdout? Anyways I like the idea of creating an actual PNG file.
$endgroup$
– Benjamin Urquhart
4 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
@BenjaminUrquhart no i mean write the bytestream to stdout, you can just redirect in the stream anyway
$endgroup$
– ASCII-only
3 hours ago
|
show 2 more comments
$begingroup$
JavaScript (Node.js), 42 bytes
_=>[Array(200704).fill([0,0,0,0]),448,448]
Apparently outputting [1D array of pixels, width, height]
is ok.
Try it online!
$endgroup$
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
add a comment |
$begingroup$
JavaScript (Node.js), 42 bytes
_=>[Array(200704).fill([0,0,0,0]),448,448]
Apparently outputting [1D array of pixels, width, height]
is ok.
Try it online!
$endgroup$
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
add a comment |
$begingroup$
JavaScript (Node.js), 42 bytes
_=>[Array(200704).fill([0,0,0,0]),448,448]
Apparently outputting [1D array of pixels, width, height]
is ok.
Try it online!
$endgroup$
JavaScript (Node.js), 42 bytes
_=>[Array(200704).fill([0,0,0,0]),448,448]
Apparently outputting [1D array of pixels, width, height]
is ok.
Try it online!
edited 2 hours ago
answered 2 hours ago
Embodiment of IgnoranceEmbodiment of Ignorance
1,678124
1,678124
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
add a comment |
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
invalid... it's a list of strings
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output
[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
Also you can output
[1D array of pixels, width, height]
$endgroup$
– ASCII-only
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
$begingroup$
@ASCII-only Fixed now
$endgroup$
– Embodiment of Ignorance
2 hours ago
add a comment |
$begingroup$
HTML, 25 bytes
Is this valid?
<svg height=448 width=448
Test it (background
applied with CSS so you can "see" it)
$endgroup$
add a comment |
$begingroup$
HTML, 25 bytes
Is this valid?
<svg height=448 width=448
Test it (background
applied with CSS so you can "see" it)
$endgroup$
add a comment |
$begingroup$
HTML, 25 bytes
Is this valid?
<svg height=448 width=448
Test it (background
applied with CSS so you can "see" it)
$endgroup$
HTML, 25 bytes
Is this valid?
<svg height=448 width=448
Test it (background
applied with CSS so you can "see" it)
answered 5 hours ago
ShaggyShaggy
19.4k21667
19.4k21667
add a comment |
add a comment |
$begingroup$
JavaScript (ES6), 74 69 bytes
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
Returns a PNG image encoded as a data: URL suitable e.g. for setting as the src
of an HTMLImageElement
. Edit: Saved 3 bytes thanks to @Shaggy and a further 2 bytes thanks to @Arnauld.
$endgroup$
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.
$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 74 69 bytes
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
Returns a PNG image encoded as a data: URL suitable e.g. for setting as the src
of an HTMLImageElement
. Edit: Saved 3 bytes thanks to @Shaggy and a further 2 bytes thanks to @Arnauld.
$endgroup$
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.
$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
add a comment |
$begingroup$
JavaScript (ES6), 74 69 bytes
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
Returns a PNG image encoded as a data: URL suitable e.g. for setting as the src
of an HTMLImageElement
. Edit: Saved 3 bytes thanks to @Shaggy and a further 2 bytes thanks to @Arnauld.
$endgroup$
JavaScript (ES6), 74 69 bytes
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
Returns a PNG image encoded as a data: URL suitable e.g. for setting as the src
of an HTMLImageElement
. Edit: Saved 3 bytes thanks to @Shaggy and a further 2 bytes thanks to @Arnauld.
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
f=
(_=document.createElement`canvas`)=>_.toDataURL(_.height=_.width=448)
;document.write(f());
edited 5 hours ago
answered 5 hours ago
NeilNeil
81.6k745178
81.6k745178
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.
$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
add a comment |
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.
$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
$begingroup$
71 bytes?
$endgroup$
– Shaggy
5 hours ago
1
1
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.$endgroup$
– Arnauld
5 hours ago
$begingroup$
document.createElement`canvas`
should work, saving 2 more bytes.$endgroup$
– Arnauld
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
$begingroup$
If createelement is valid would seeing document.body and using the fact an id becomes a variable be valid? Also stack snippet pls
$endgroup$
– ASCII-only
5 hours ago
add a comment |
$begingroup$
SmileBASIC, 27 bytes
DIM A[448,448]SAVE"DAT:I",A
Saves a 2-dimensional 448x448 array filled with 0s to a file named DAT:I
$endgroup$
add a comment |
$begingroup$
SmileBASIC, 27 bytes
DIM A[448,448]SAVE"DAT:I",A
Saves a 2-dimensional 448x448 array filled with 0s to a file named DAT:I
$endgroup$
add a comment |
$begingroup$
SmileBASIC, 27 bytes
DIM A[448,448]SAVE"DAT:I",A
Saves a 2-dimensional 448x448 array filled with 0s to a file named DAT:I
$endgroup$
SmileBASIC, 27 bytes
DIM A[448,448]SAVE"DAT:I",A
Saves a 2-dimensional 448x448 array filled with 0s to a file named DAT:I
answered 2 hours ago
12Me2112Me21
5,57711336
5,57711336
add a comment |
add a comment |
$begingroup$
Rust - 206 201 bytes
use std::{fs::File,io::Write};fn main(){File::create("o.tga").unwrap().write(&vec![0,0,2,0,0,0,0,0,0,0,0,0,192,1,192,1,32,0].iter().chain(vec![0u8;802816].iter()).map(|n|*n).collect::<Vec<u8>>());}
This write an actual, readable .tga file, per http://paulbourke.net/dataformats/tga/ by hard coding the width,height, into the binary file header.
-5 bytes shorten filename, fix img size, @ASCII-only
$endgroup$
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well alsoa
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be10
not2
. even better, colormap for shorter run length encoding (0,0,0,0
->0
)
$endgroup$
– ASCII-only
1 hour ago
|
show 4 more comments
$begingroup$
Rust - 206 201 bytes
use std::{fs::File,io::Write};fn main(){File::create("o.tga").unwrap().write(&vec![0,0,2,0,0,0,0,0,0,0,0,0,192,1,192,1,32,0].iter().chain(vec![0u8;802816].iter()).map(|n|*n).collect::<Vec<u8>>());}
This write an actual, readable .tga file, per http://paulbourke.net/dataformats/tga/ by hard coding the width,height, into the binary file header.
-5 bytes shorten filename, fix img size, @ASCII-only
$endgroup$
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well alsoa
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be10
not2
. even better, colormap for shorter run length encoding (0,0,0,0
->0
)
$endgroup$
– ASCII-only
1 hour ago
|
show 4 more comments
$begingroup$
Rust - 206 201 bytes
use std::{fs::File,io::Write};fn main(){File::create("o.tga").unwrap().write(&vec![0,0,2,0,0,0,0,0,0,0,0,0,192,1,192,1,32,0].iter().chain(vec![0u8;802816].iter()).map(|n|*n).collect::<Vec<u8>>());}
This write an actual, readable .tga file, per http://paulbourke.net/dataformats/tga/ by hard coding the width,height, into the binary file header.
-5 bytes shorten filename, fix img size, @ASCII-only
$endgroup$
Rust - 206 201 bytes
use std::{fs::File,io::Write};fn main(){File::create("o.tga").unwrap().write(&vec![0,0,2,0,0,0,0,0,0,0,0,0,192,1,192,1,32,0].iter().chain(vec![0u8;802816].iter()).map(|n|*n).collect::<Vec<u8>>());}
This write an actual, readable .tga file, per http://paulbourke.net/dataformats/tga/ by hard coding the width,height, into the binary file header.
-5 bytes shorten filename, fix img size, @ASCII-only
edited 1 hour ago
answered 3 hours ago
don brightdon bright
578411
578411
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well alsoa
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be10
not2
. even better, colormap for shorter run length encoding (0,0,0,0
->0
)
$endgroup$
– ASCII-only
1 hour ago
|
show 4 more comments
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well alsoa
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be10
not2
. even better, colormap for shorter run length encoding (0,0,0,0
->0
)
$endgroup$
– ASCII-only
1 hour ago
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it need to be printed to a file though :P
$endgroup$
– ASCII-only
3 hours ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
does it even need to be 2 dimensional? I could just say [0;444*444*4]; and say i created a 444x444 transparent image. im making it interesting.
$endgroup$
– don bright
1 hour ago
$begingroup$
well also
a
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid$endgroup$
– ASCII-only
1 hour ago
$begingroup$
well also
a
would work as file name would it not. btw it's 448*448 not 444*444 so this is invalid$endgroup$
– ASCII-only
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
oops, ha ha thanks
$endgroup$
– don bright
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be
[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be 10
not 2
. even better, colormap for shorter run length encoding (0,0,0,0
-> 0
)$endgroup$
– ASCII-only
1 hour ago
$begingroup$
to make it even more interesting, run length encode it :P (image data should be
[255,0,0,0,0]
6272 times ([0,0,0,0]
128 times, repeated 6272 times). image type would then be 10
not 2
. even better, colormap for shorter run length encoding (0,0,0,0
-> 0
)$endgroup$
– ASCII-only
1 hour ago
|
show 4 more comments
$begingroup$
Jstx, 24 bytes
♪☺ü@/øP♦£Q)%)£Q◄úæD)%)£Q
Explanation
♪☺ü@ # Push literal 448
/ # Store the first stack value in the a register.
ø # Push literal 0
P # Push four copies of the first stack value.
♦ # Push literal 4
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
◄úæ # Push literal n
D # Push the sum of the second and first stack values.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
Try it online!
$endgroup$
add a comment |
$begingroup$
Jstx, 24 bytes
♪☺ü@/øP♦£Q)%)£Q◄úæD)%)£Q
Explanation
♪☺ü@ # Push literal 448
/ # Store the first stack value in the a register.
ø # Push literal 0
P # Push four copies of the first stack value.
♦ # Push literal 4
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
◄úæ # Push literal n
D # Push the sum of the second and first stack values.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
Try it online!
$endgroup$
add a comment |
$begingroup$
Jstx, 24 bytes
♪☺ü@/øP♦£Q)%)£Q◄úæD)%)£Q
Explanation
♪☺ü@ # Push literal 448
/ # Store the first stack value in the a register.
ø # Push literal 0
P # Push four copies of the first stack value.
♦ # Push literal 4
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
◄úæ # Push literal n
D # Push the sum of the second and first stack values.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
Try it online!
$endgroup$
Jstx, 24 bytes
♪☺ü@/øP♦£Q)%)£Q◄úæD)%)£Q
Explanation
♪☺ü@ # Push literal 448
/ # Store the first stack value in the a register.
ø # Push literal 0
P # Push four copies of the first stack value.
♦ # Push literal 4
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
◄úæ # Push literal n
D # Push the sum of the second and first stack values.
) # Push the value contained in the a register.
% # Push the second stack value the absolute value of the first stack value times.
) # Push the value contained in the a register.
£Q # Push stack values into a list of the size of the first stack value starting with the second stack value.
Try it online!
answered 21 mins ago
Quantum64Quantum64
15110
15110
add a comment |
add a comment |
If this is an answer to a challenge…
…Be sure to follow the challenge specification. However, please refrain from exploiting obvious loopholes. Answers abusing any of the standard loopholes are considered invalid. If you think a specification is unclear or underspecified, comment on the question instead.
…Try to optimize your score. For instance, answers to code-golf challenges should attempt to be as short as possible. You can always include a readable version of the code in addition to the competitive one.
Explanations of your answer make it more interesting to read and are very much encouraged.…Include a short header which indicates the language(s) of your code and its score, as defined by the challenge.
More generally…
…Please make sure to answer the question and provide sufficient detail.
…Avoid asking for help, clarification or responding to other answers (use comments instead).
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodegolf.stackexchange.com%2fquestions%2f181409%2fmake-a-transparent-448448-image%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
4
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
8 hours ago