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$
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins 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 2 hours ago
AnushAnush
773425
773425
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins ago
add a comment |
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins ago
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins ago
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins ago
add a comment |
8 Answers
8
active
oldest
votes
$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
59 mins ago
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$
Processing, 66 bytes
PGraphics g=createGraphics(448,448);g.beginDraw();g.save("a.png");
$endgroup$
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
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$
Jelly, 10 bytes
x4Wẋ448Ɗ2¡
Try it online!
Outputs a 448x448x4 array
$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, 101 bytes
Outputs an empty png image saved as a file with the given name s
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins 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 |
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
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
$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
59 mins 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
59 mins 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 1 hour ago
zeveezevee
27016
27016
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
59 mins ago
add a comment |
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
59 mins ago
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
59 mins ago
$begingroup$
Oh! I had no idea this would work. It's surprising and clever, so yes!
$endgroup$
– Anush
59 mins ago
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$
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 2 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 1 hour ago
dzaimadzaima
15.3k21856
15.3k21856
add a comment |
add a comment |
$begingroup$
C# (Visual C# Interactive Compiler), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
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), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
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), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
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), 58 bytes
_=>Enumerable.Repeat(Enumerable.Repeat((0,0,0,0),448),448)
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!
answered 1 hour ago
Embodiment of IgnoranceEmbodiment of Ignorance
1,658124
1,658124
add a comment |
add a comment |
$begingroup$
Jelly, 10 bytes
x4Wẋ448Ɗ2¡
Try it online!
Outputs a 448x448x4 array
$endgroup$
add a comment |
$begingroup$
Jelly, 10 bytes
x4Wẋ448Ɗ2¡
Try it online!
Outputs a 448x448x4 array
$endgroup$
add a comment |
$begingroup$
Jelly, 10 bytes
x4Wẋ448Ɗ2¡
Try it online!
Outputs a 448x448x4 array
$endgroup$
Jelly, 10 bytes
x4Wẋ448Ɗ2¡
Try it online!
Outputs a 448x448x4 array
answered 1 hour ago
Nick KennedyNick Kennedy
63137
63137
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 1 hour ago
dzaimadzaima
15.3k21856
15.3k21856
add a comment |
add a comment |
$begingroup$
Java 8, 101 bytes
Outputs an empty png image saved as a file with the given name s
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins ago
add a comment |
$begingroup$
Java 8, 101 bytes
Outputs an empty png image saved as a file with the given name s
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
$endgroup$
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins ago
add a comment |
$begingroup$
Java 8, 101 bytes
Outputs an empty png image saved as a file with the given name s
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
$endgroup$
Java 8, 101 bytes
Outputs an empty png image saved as a file with the given name s
s->javax.imageio.ImageIO.write(new java.awt.image.BufferedImage(448,448,2),"png",new java.io.File(s))
Try it online... somehow
answered 40 mins ago
Benjamin UrquhartBenjamin Urquhart
714
714
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins ago
add a comment |
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins ago
1
1
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins ago
$begingroup$
Do you mean empty or transparent?
$endgroup$
– Anush
39 mins 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
37 mins 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
37 mins 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 6 mins ago
Embodiment of Ignorance
1,658124
1,658124
answered 58 mins ago
zeveezevee
27016
27016
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
$begingroup$
What's to stop people from submitting a 0-byte answer which "outputs" a transparent (invisible) image to the screen?
$endgroup$
– 12Me21
26 mins ago