The linux kernel does not need to be compressed at all.
However… for most of us…
It will necessarily be :
Let's investigate the Kernel compression mode sub menu offered as part of the make menuconfig kernel makefile :
( ) Gzip
( ) Bzip2
( ) LZMA
( ) XZ
( ) LZO
(X) LZ4
You just get the choice between compression algos. Just no way to escape compression.
Wait! Let's now investigate the help from the kernel :
Depends on: HAVE_KERNEL_GZIP [=y] || HAVE_KERNEL_BZIP2 [=y] || HAVE_KERNEL_LZMA [=y] || HAVE_KERNEL_XZ [=y] || HAVE_KERNEL_LZO [=y] || HAVE_KERNEL_LZ4 [=y] || HAVE_KERNEL_UNCOMPRESSED [=n]
OK all this will depend on the availability of compression algorithms but also on the setting of the HAVE_KERNEL_UNCOMPRESSED config option.
Unfortunately this option is not offered for modification as part of the menu. It is hardcoded in init/Kconfig :
config KERNEL_UNCOMPRESSED
bool "None"
depends on HAVE_KERNEL_UNCOMPRESSED
help
Produce uncompressed kernel image. This option is usually not what
you want. It is useful for debugging the kernel in slow simulation
environments, where decompressing and moving the kernel is awfully
slow. This option allows early boot code to skip the decompressor
and jump right at uncompressed kernel image.
You then get the answer to your question : No, the kernel image does not need to be compressed and the kernel configuration offers a somehow hidden possibility not to compress it. However for any standard user the kernel image will obligatorily be compressed because… because… an uncompressed image is "usually not what you want"… ;-)
Moreover : The patch allowing the build of uncompressed image (via an option directly available from make menuconfig) appeared buggy on x86_64 arches. I cannot tell its current status on this arch but is indeed working on s390 arches (see arch/s390/Kconfig)