  Image outpainting gains increasing attention since it can generate the
complete scene from a partial view, providing a valuable solution to construct
{360\textdegree} panoramic images. As image outpainting suffers from the
intrinsic issue of unidirectional completion flow, previous methods convert the
original problem into inpainting, which allows a bidirectional flow. However,
we find that inpainting has its own limitations and is inferior to outpainting
in certain situations. The question of how they may be combined for the best of
both has as yet remained under-explored. In this paper, we provide a deep
analysis of the differences between inpainting and outpainting, which
essentially depends on how the source pixels contribute to the unknown regions
under different spatial arrangements. Motivated by this analysis, we present a
Cylin-Painting framework that involves meaningful collaborations between
inpainting and outpainting and efficiently fuses the different arrangements,
with a view to leveraging their complementary benefits on a seamless cylinder.
Nevertheless, straightforwardly applying the cylinder-style convolution often
generates visually unpleasing results as it discards important positional
information. To address this issue, we further present a learnable positional
embedding strategy to incorporate the missing component of positional encoding
into the cylinder convolution, which significantly improves the panoramic
results. It is noted that while developed for image outpainting, the proposed
algorithm can be effectively extended to other panoramic vision tasks, such as
object detection, depth estimation, and image super-resolution. Code will be
made available at \url{https://github.com/KangLiao929/Cylin-Painting}.
